Page 1 of 2

Issue with profiles after update to IM 7

Posted: 2016-10-20T01:22:38-07:00
by the-ninth
Hi,

My website's server was previously using IM 6 but the hoster has now upgraded to IM 7. Since then some code that I used for profile handling does not work anymore.

With IM 6 I used the following command to export a color profile from a source file, strip away all meta data and then include the profile again:

convert source.jpg -write profile.icc -strip -profile profile.icc target.jpg

With IM 7 profile.icc still contains the profile, but target.jpg is without a profile. With IM 6, target.jpg contained the profile.

I have written a small test program to verify this: http://www.the-ninth.com/test/test.php

On my local test installation with IM 6.6 this still works, on my server (the one from the link above) it does not.

I already checked the porting guide (http://www.imagemagick.org/script/porting.php) but could not find anything related to profile handling.

Any hints on how to solve this would be highly appreciated!

Thanks!

Regards, Robert

Re: Issue with profiles after update to IM 7

Posted: 2016-10-20T05:04:19-07:00
by snibgo
On IM v7.0.2-5 under Windows 8.1, it works fine, both for "magick" and "magick convert".

I suggest you try with those two commands.

Re: Issue with profiles after update to IM 7

Posted: 2016-10-20T05:55:13-07:00
by the-ninth
Thanks. Cannot finde the magick command on my server, have to check with the hosting company how I can access it. There is a /usr/bin/convert, but there is no /usr/bin/magick. Since I do not have full access to the server I cannot check myself.

In any case, with IM 7, should convert not be just an alias of magick?

Re: Issue with profiles after update to IM 7

Posted: 2016-10-20T10:26:05-07:00
by fmw42
What is your platform? On unix, the install should make convert a symbolic link to magick. However, there should be a magick command. I suspect your server people have install IM 7 in a different location such as /usr/local/bin.

What do you get from

/usr/bin/convert -version
/usr/bin/magick -version

and

/usr/local/bin/convert -version
/usr/local/bin/magick -version

and

convert -version
magick -version


or

type -a convert
type -a magick

Re: Issue with profiles after update to IM 7

Posted: 2016-10-20T11:48:37-07:00
by the-ninth
OK, my bad, /usr/bin/magick actually exists. Version is 7.0.2-5 Q16 x86_64. /usr/local/bin/convert or magick does not exist. Using the commands without path gives me the same version.

In any case, switching from convert to magick does not solve the issue. I still don't get the color profile in the target file.

Re: Issue with profiles after update to IM 7

Posted: 2016-10-20T12:05:12-07:00
by fmw42
I suggest you post your input file to some place such as dropbox.com and put the URL here. Then we can test your command with your image.

If you change -write to +write, does it work?

Re: Issue with profiles after update to IM 7

Posted: 2016-10-20T12:09:27-07:00
by the-ninth
With +write the result is the same.

The file can be found at: http://www.the-ninth.com/test/source.jpg

With IM 6.6 everything works as expected with the same source file.

Thanks for your support!

Re: Issue with profiles after update to IM 7

Posted: 2016-10-20T12:11:22-07:00
by fmw42
try

Code: Select all

magick source.jpg +write profile.icc null:
magick source.jpg -strip -profile profile.icc target.jpg

Re: Issue with profiles after update to IM 7

Posted: 2016-10-20T12:14:58-07:00
by fmw42
Works fine for me on IM 7.0.3-4 Q16 Mac OSX. See below where target.jpg contains the line:

icc:description: sRGB IEC61966-2.1

Code: Select all

magick source.jpg -write profile.icc -strip -profile profile.icc target.jpg
magick identify -verbose target.jpg
Image: target.jpg
  Format: JPEG (Joint Photographic Experts Group JFIF format)
  Mime type: image/jpeg
  Class: DirectClass
  Geometry: 3000x2000+0+0
  Resolution: 240x240
  Print size: 12.5x8.33333
  Units: PixelsPerInch
  Type: TrueColor
  Endianess: Undefined
  Colorspace: sRGB
  Depth: 8-bit
  Channel depth:
    Red: 8-bit
    Green: 8-bit
    Blue: 8-bit
  Channel statistics:
    Pixels: 6000000
    Red:
      min: 0 (0)
      max: 255 (1)
      mean: 107.136 (0.420143)
      standard deviation: 72.8442 (0.285664)
      kurtosis: -1.19266
      skewness: 0.0794885
      entropy: 0.974289
    Green:
      min: 0 (0)
      max: 255 (1)
      mean: 86.6918 (0.339968)
      standard deviation: 66.1751 (0.25951)
      kurtosis: -0.677729
      skewness: 0.530226
      entropy: 0.957667
    Blue:
      min: 0 (0)
      max: 255 (1)
      mean: 71.2798 (0.279529)
      standard deviation: 64.7354 (0.253864)
      kurtosis: 0.0886241
      skewness: 0.950106
      entropy: 0.934487
  Image statistics:
    Overall:
      min: 0 (0)
      max: 255 (1)
      mean: 88.3693 (0.346546)
      standard deviation: 68.01 (0.266706)
      kurtosis: -0.62924
      skewness: 0.53576
      entropy: 0.955481
  Rendering intent: Perceptual
  Gamma: 0.454545
  Chromaticity:
    red primary: (0.64,0.33)
    green primary: (0.3,0.6)
    blue primary: (0.15,0.06)
    white point: (0.3127,0.329)
  Alpha color: grey74
  Background color: white
  Border color: srgb(223,223,223)
  Transparent color: none
  Interlace: None
  Intensity: Undefined
  Compose: Over
  Page geometry: 3000x2000+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: JPEG
  Quality: 99
  Orientation: Undefined
  Properties:
    date:create: 2016-10-20T23:18:09-07:00
    date:modify: 2016-10-20T23:18:09-07:00
    icc:copyright: Copyright (c) 1998 Hewlett-Packard Company
    icc:description: sRGB IEC61966-2.1
    icc:manufacturer: IEC http://www.iec.ch
    icc:model: IEC 61966-2.1 Default RGB colour space - sRGB
    jpeg:colorspace: 2
    jpeg:sampling-factor: 1x1,1x1,1x1
    signature: 29b8b13246bb0002b27bd39281c16603fe390c011375840104509318449669ef
  Profiles:
    Profile-icc: 3144 bytes
  Artifacts:
    verbose: true
  Tainted: False
  Filesize: 4.733MB
  Number pixels: 6M
  Pixels per second: 19.35MB
  User time: 0.310u
  Elapsed time: 0:01.309
  Version: ImageMagick 7.0.3-4 Q16 x86_64 2016-10-17 http://www.imagemagick.org

Re: Issue with profiles after update to IM 7

Posted: 2016-10-20T12:36:19-07:00
by the-ninth
Just installed ImageMagick 7.0.3-4 Q16 x64 on my home PC and there it works as well. So either it is something related to version 7.0.2-5 Q16 x86_64 or it has something to do with the setup of my web hosting server.

Is there a way to download 7.0.2-5 somewhere for Windows? I could only find 7.0.3-4 for download.

Re: Issue with profiles after update to IM 7

Posted: 2016-10-20T13:12:33-07:00
by fmw42
As source or binary?

Re: Issue with profiles after update to IM 7

Posted: 2016-10-20T21:44:47-07:00
by the-ninth
I'd need the binary.

Re: Issue with profiles after update to IM 7

Posted: 2016-10-20T22:23:57-07:00
by the-ninth
fmw42 wrote:try

Code: Select all

magick source.jpg +write profile.icc null:
magick source.jpg -strip -profile profile.icc target.jpg
Also tried this suggestion, but the result is the same. The first command correctly writes the profile, but still, after the second, target.jpg does not contain the profile. Even when I split it in three to separate the -strip and the -profile it does not work.

Code: Select all

/usr/bin/magick source.jpg +write profile_from_source.icc null:
/usr/bin/magick source.jpg -strip target_temp.jpg
/usr/bin/magick target_temp.jpg -profile profile_from_source.icc target.jpg 
So, whatever I do, the -profile parameter does not seem to work on my hosting web server. :(

Is there anything my hoster could have done wrong when installing ImageMagick? Does the -profile need any libraries to work, or something else that could be missing?

Re: Issue with profiles after update to IM 7

Posted: 2016-10-20T23:14:43-07:00
by snibgo
I believe "-profile" needs LCMS. "convert -version" should list LCMS as a built-in delegate.

Re: Issue with profiles after update to IM 7

Posted: 2016-10-20T23:22:07-07:00
by the-ninth
snibgo wrote:I believe "-profile" needs LCMS. "convert -version" should list LCMS as a built-in delegate.
Thanks for the hint, then that may be the issue. My hosting web server does not list LCMS in the delegates. Will ask my provider about it.

Code: Select all

Version: ImageMagick 7.0.2-5 Q16 x86_64 2016-08-03 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2016 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI
Delegates (built-in): bzlib fontconfig freetype jng jpeg png tiff wmf x xml