command-line freeze on some images when converting from exr to jpg

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
sdas
Posts: 9
Joined: 2016-09-12T10:46:48-07:00
Authentication code: 1151

command-line freeze on some images when converting from exr to jpg

Post by sdas »

I'm getting a freeze on some EXR images when converting to jpeg.
A dialog box immediately pops up with this message:
"ImageMagick Studio library and utillity programs has stopped working
A problem caused the program to stop working correctly.
Windows will close the program and notify you if a solution is available"

It SEEMS to happen on images where the EXR dataWindow parameter is different from the displayWindow parameter (as reported by RV).
On the offending images I see:
EXR/displayWindow: (0 0) - (1919 802)
EXR/dataWindow: (-1 0) - (1920 803)
On good images, they are both: (0 0) - (1919 802)

Any ideas? I can provide a working and a non-working image if needed.

Thanks!

User avatar
magick
Site Admin
Posts: 11254
Joined: 2003-05-31T11:32:55-07:00

Re: command-line freeze on some images when converting from exr to jpg

Post by magick »

Post a URL to an image we can download to reproduce the problem. Thanks.

sdas
Posts: 9
Joined: 2016-09-12T10:46:48-07:00
Authentication code: 1151

Re: command-line freeze on some images when converting from exr to jpg

Post by sdas »

Here's an image that failed for me: https://drive.google.com/file/d/0B-qdEk ... sp=sharing

The command line I used was on Windows 7, version ImageMagick-7.0.2-Q16:
magick.exe srcfile.exr -scene 0101 dstfile.jpg

User avatar
fmw42
Posts: 26383
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: command-line freeze on some images when converting from exr to jpg

Post by fmw42 »

Using Mac OSX Snow Leopard with

Version: ImageMagick 7.0.2-7 Q16 x86_64 2016-08-11 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2016 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules
Delegates (built-in): bzlib cairo fftw fontconfig freetype gslib jbig jng jp2 jpeg lcms lqr ltdl lzma openexr png ps rsvg tiff webp x xml zlib

And command:

Code: Select all

im7 magick sq020shr_s050_v002.0103.exr tmp.jpg
I am getting the following error message:

Code: Select all

magick: unable to load module '/Users/fred/Applications/ImageMagick-7.0.2-7q16h/coders/exr.la': file not found @ error/module.c/OpenModule/1279.
magick: no decode delegate for this image format `EXR' @ error/constitute.c/ReadImage/508.
magick: no image to apply a property "%w" @ warning/property.c/GetMagickPropertyLetter/2550.
magick: unknown image property "%w" @ warning/property.c/InterpretImageProperties/3489.
magick: no image to apply a property "%h" @ warning/property.c/GetMagickPropertyLetter/2438.
magick: unknown image property "%h" @ warning/property.c/InterpretImageProperties/3489.
magick: no image to apply a property "%m" @ warning/property.c/GetMagickPropertyLetter/2469.
magick: unknown image property "%m" @ warning/property.c/InterpretImageProperties/3489.
This file is at
/usr/local/lib/ImageMagick-6.9.5/modules-Q16/coders/exr.la

But I cannot find this file for IM 7 (perhaps because I have not done sudo make install.


I am downloading using MacPorts and configuring IM from source using:

Code: Select all

./configure CPPFLAGS='-I/opt/local/include' LDFLAGS='-L/opt/local/lib' \
  --enable-delegate-build --enable-shared --disable-static --disable-opencl \
  --with-modules --with-quantum-depth=16 --enable-hdri --with-gslib --without-wmf --with-rsvg \
  --disable-silent-rules --disable-dependency-tracking --without-pango \
  --with-gs-font-dir=/opt/local/share/ghostscript/fonts/ --with-lqr
and then just doing a make and running IM 7 from the download folder with a script im7, so that I can run multiple versions of IM at the same time.

User avatar
magick
Site Admin
Posts: 11254
Joined: 2003-05-31T11:32:55-07:00

Re: command-line freeze on some images when converting from exr to jpg

Post by magick »

We tried your image under Linux and it converted without complaint. Hopefully @dirk will try converting under Windows. If not, we'll try it in a day or two and report back.

sdas
Posts: 9
Joined: 2016-09-12T10:46:48-07:00
Authentication code: 1151

Re: command-line freeze on some images when converting from exr to jpg

Post by sdas »

Not for the first time, I wish we were using LInux... Thanks, let me know what you discover.

snibgo
Posts: 13034
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: command-line freeze on some images when converting from exr to jpg

Post by snibgo »

For me, on Windows 8.1, neither v6.9.5-3 no v7.0.2-5 can convert or even "identify -verbose" the file. The programs produce no output.

Code: Select all

convert -debug all sq020shr_s050_v002.0103.exr -verbose info:
The debug output is:

Code: Select all

2016-09-13T01:24:48+01:00 0:00.000 0.000u 6.9.5 Configure convert.exe[19400]: utility.c/ExpandFilenames/940/Configure
  Command line: c:\im\ImageMagick-6.9.5-3-Q16\convert {-debug} {all} {sq020shr_s050_v002.0103.exr} {-verbose} {info:}
2016-09-13T01:24:48+01:00 0:00.000 0.000u 6.9.5 Policy convert.exe[19400]: policy.c/IsRightsAuthorized/580/Policy
  Domain: Path; rights=Read; pattern="sq020shr_s050_v002.0103.exr" ...
2016-09-13T01:24:48+01:00 0:00.000 0.000u 6.9.5 Blob convert.exe[19400]: blob.c/OpenBlob/2597/Blob
    read 3 magic header bytes
2016-09-13T01:24:48+01:00 0:00.000 0.000u 6.9.5 Cache convert.exe[19400]: cache.c/DestroyPixelCache/1121/Cache
  destroy 
2016-09-13T01:24:48+01:00 0:00.000 0.000u 6.9.5 Configure convert.exe[19400]: nt-base.c/NTRegistryKeyLookup/1959/Configure
  SOFTWARE\ImageMagick\6.9.5\Q:16
2016-09-13T01:24:48+01:00 0:00.000 0.000u 6.9.5 Configure convert.exe[19400]: nt-base.c/NTRegistryKeyLookup/1980/Configure
  ConfigurePath
2016-09-13T01:24:48+01:00 0:00.000 0.000u 6.9.5 Configure convert.exe[19400]: configure.c/GetConfigureOptions/685/Configure
  Searching for configure file: "C:\im\ImageMagick-6.9.5-3-Q16\magic.xml"
2016-09-13T01:24:48+01:00 0:00.000 0.000u 6.9.5 Configure convert.exe[19400]: configure.c/GetConfigureOptions/685/Configure
  Searching for configure file: "C:\Users\Alan\AppData\Local\ImageMagick\magic.xml"
2016-09-13T01:24:48+01:00 0:00.000 0.000u 6.9.5 Configure convert.exe[19400]: magic.c/LoadMagicCache/796/Configure
  Loading magic configure file "C:\im\ImageMagick-6.9.5-3-Q16\magic.xml" ...
2016-09-13T01:24:48+01:00 0:00.000 0.000u 6.9.5 Policy convert.exe[19400]: policy.c/IsRightsAuthorized/580/Policy
  Domain: Coder; rights=Read; pattern="EXR" ...
2016-09-13T01:24:48+01:00 0:00.000 0.000u 6.9.5 Policy convert.exe[19400]: policy.c/IsRightsAuthorized/580/Policy
  Domain: Path; rights=Read; pattern="sq020shr_s050_v002.0103.exr" ...
2016-09-13T01:24:48+01:00 0:00.000 0.000u 6.9.5 Blob convert.exe[19400]: blob.c/OpenBlob/2597/Blob
    read 3 magic header bytes
2016-09-13T01:24:48+01:00 0:00.000 0.000u 6.9.5 Resource convert.exe[19400]: resource.c/AcquireMagickResource/313/Resource
  Width: 1.92KB/1.92KB/214.7MB
2016-09-13T01:24:48+01:00 0:00.000 0.000u 6.9.5 Resource convert.exe[19400]: resource.c/AcquireMagickResource/313/Resource
  Height: 803B/803B/214.7MB
2016-09-13T01:24:48+01:00 0:00.000 0.000u 6.9.5 Resource convert.exe[19400]: resource.c/AcquireMagickResource/313/Resource
  Area: 12.33MB/12.33MB/8.4474GB
2016-09-13T01:24:48+01:00 0:00.000 0.000u 6.9.5 Resource convert.exe[19400]: resource.c/AcquireMagickResource/313/Resource
  Memory: 12.33MB/11.76MiB/3.9336GiB
2016-09-13T01:24:48+01:00 0:00.000 0.000u 6.9.5 Cache convert.exe[19400]: cache.c/OpenPixelCache/3871/Cache
  open sq020shr_s050_v002.0103.exr[0] (Heap Memory, 1920x803 11.76MiB)

snibgo's IM pages: im.snibgo.com

sdas
Posts: 9
Joined: 2016-09-12T10:46:48-07:00
Authentication code: 1151

Re: command-line freeze on some images when converting from exr to jpg

Post by sdas »

That's similar to what I get.

Contrast that to another file in the same sequence:
https://drive.google.com/open?id=0B-qdE ... UJqUV9ONm8

Which (for me) converts fine, and shows image information with the debug command line.

RV Recognizes them both as legit RV image files, and both were output from nuke.

snibgo
Posts: 13034
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: command-line freeze on some images when converting from exr to jpg

Post by snibgo »

Yes, that file converts for me, v6 or v7, with no problem. (It's a dark image, but perhaps it's supposed to be.)
snibgo's IM pages: im.snibgo.com

sdas
Posts: 9
Joined: 2016-09-12T10:46:48-07:00
Authentication code: 1151

Re: command-line freeze on some images when converting from exr to jpg

Post by sdas »

Yeah, it's a dark image on purpose. Thanks for confirming that it works for you.

User avatar
dlemstra
Posts: 1625
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: command-line freeze on some images when converting from exr to jpg

Post by dlemstra »

I am getting an access violation under Windows when I try to open your image. It looks like a bug inside the OpenEXR library. I will try and see if I can figure out the bug.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate

User avatar
dlemstra
Posts: 1625
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: command-line freeze on some images when converting from exr to jpg

Post by dlemstra »

It turns out that our code contains a bug when reading the pixel data. I get the following output after the fix: https://www.dropbox.com/sh/a4qcg5jflgpc ... gKHLa?dl=0
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate

sdas
Posts: 9
Joined: 2016-09-12T10:46:48-07:00
Authentication code: 1151

Re: command-line freeze on some images when converting from exr to jpg

Post by sdas »

Great! Will this fix be pushed out soon, or is there a way I can get a patch?

Thanks!

User avatar
dlemstra
Posts: 1625
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: command-line freeze on some images when converting from exr to jpg

Post by dlemstra »

If you want to build from source you can apply the following patch: http://git.imagemagick.org/repos/ImageM ... 4f1f0e89ea. A new version will be available within a couple weeks.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate

sdas
Posts: 9
Joined: 2016-09-12T10:46:48-07:00
Authentication code: 1151

Re: command-line freeze on some images when converting from exr to jpg

Post by sdas »

I can wait a couple of weeks I think. Will there be a notification when the new version comes out?

Locked