don't attempt to save large XMP to JPG
jpeg_write_marker() with some libjpeg versions will throw a fatal error with large chunks. To write >64kb XMP it you need to parse the whole XMP object, pull out the most important fields, code just them into the main XMP block, then write any remaining XMP objects into a set of extended XMP markers. http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/xmp/pdfs/XMPSpecificationPart3.pdf Instead, just warn and skip large XMP blocks. see https://github.com/libvips/libvips/issues/1372
This commit is contained in:
parent
7f47acab56
commit
8cf6a9f9ca
@ -1,5 +1,6 @@
|
||||
9/7/19 started 8.8.2
|
||||
- better early shutdown in readers
|
||||
- don't attempt to save large XMP to jpeg [tnextday]
|
||||
|
||||
24/5/19 started 8.8.1
|
||||
- improve realpath() use on older libc
|
||||
|
@ -88,6 +88,8 @@
|
||||
* - fix a leak with an error during buffer output
|
||||
* 19/4/19
|
||||
* - fix another leak with error during buffer output
|
||||
* 19/7/19
|
||||
* - ignore large XMP
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -285,6 +287,22 @@ write_xmp( Write *write )
|
||||
(void *) &data, &data_length ) )
|
||||
return( -1 );
|
||||
|
||||
/* To write >64kb XMP it you need to parse the whole XMP object,
|
||||
* pull out the most important fields, code just them into the main
|
||||
* XMP block, then write any remaining XMP objects into a set of
|
||||
* extended XMP markers.
|
||||
*
|
||||
* http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/xmp/pdfs/ \
|
||||
* XMPSpecificationPart3.pdf
|
||||
*
|
||||
* jpeg_write_marker() with some libjpeg versions will throw a fatal
|
||||
* error with large chunks.
|
||||
*/
|
||||
if( data_length > 60000 ) {
|
||||
g_warning( "%s", _( "VipsJpeg: large XMP not saved" ) );
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
/* We need to add the magic XML URL to the start, then a null
|
||||
* character, then the data.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user