diff --git a/ChangeLog b/ChangeLog index 481e3124..4c5f5675 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,7 @@ - "header" sets a non-zero exit code if anything failed - add and use im_check_uncoded() and friends - matlab load handles column-major and plane-separated images (thanks Mikhail) +- JPEG save allows "none" for profile, meaning don't attach a profile 25/3/09 started 7.18.0 - revised version numbers diff --git a/libsrc/format/im_vips2jpeg.c b/libsrc/format/im_vips2jpeg.c index c145dad0..9e39029b 100644 --- a/libsrc/format/im_vips2jpeg.c +++ b/libsrc/format/im_vips2jpeg.c @@ -27,6 +27,8 @@ * - write CMYK if Bands == 4 and Type == CMYK * 12/5/09 * - fix signed/unsigned warning + * 13/8/09 + * - allow "none" for profile, meaning don't embed one */ /* @@ -612,8 +614,10 @@ write_vips( Write *write, int qfac, const char *profile ) return( -1 ); /* A profile supplied as an argument overrides an embedded profile. + * "none" means don't attach a profile. */ if( profile && + strcmp( profile, "none" ) != 0 && write_profile_file( write, profile ) ) return( -1 ); if( !profile && diff --git a/man/im_jpeg2vips.3 b/man/im_jpeg2vips.3 index a24c8adc..a4131c66 100644 --- a/man/im_jpeg2vips.3 +++ b/man/im_jpeg2vips.3 @@ -33,7 +33,7 @@ will return fred.jpg shrink by a factor of 8. .B fail makes the JPEG reader fail on any warnings. This can be useful for detecting -truncated files, for example: normally reading these produces a warning, but +truncated files, for example. Normally reading these produces a warning, but no fatal error. Example: fred.jpg:,fail @@ -42,7 +42,8 @@ will read fred.jpg, failing with a fatal error if the file has been truncated. Any embedded ICC profiles are ignored: you always just get the RGB from the file. Instead, the embedded profile will be attached to the image as metadata. -Any EXIF data is also attached as VIPS metadata. +You need to use something like im_icc_import(3) to get CIE values from the +file. Any EXIF data is also attached as VIPS metadata. .B im_vips2jpeg(3) writes the IMAGE to filename in JPEG format. It uses the @@ -53,16 +54,17 @@ A compression factor may be encoded in the filename: for example, "fred.jpg:25" will write with factor 25. An ICC profile may also be specified. For example, -"fred.jpg:25,/home/john/srgb.icc" will embed the profile stored in the file +"fred.jpg:,/home/john/srgb.icc" will embed the profile stored in the file "/home/john/srgb.icc" into the JPEG image. This does not affect the pixels -which are written; just the way they are tagged. +which are written, just the way they are tagged. You can use the special +string "none" to mean "don't attach a profile". If no profile is specified in the save string and the VIPS header contains an ICC profile named IM_META_ICC_NAME ("icc-profile-data"), the -profile from the header will be attached. +profile from the VIPS header will be attached. -The image is automatically converted to RGB or Monochrome before saving. Any -metadata attached to the image is saved as EXIF, if possible. +The image is automatically converted to RGB, Monochrome or CMYK before saving. +Any metadata attached to the image is saved as EXIF, if possible. .B im_vips2bufjpeg(3) returns the compressed image in a memory buffer. The buffer