Cannot convert jp2 to jpg

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
kasperite
Posts: 3
Joined: 2015-09-01T19:35:49-07:00
Authentication code: 1151

Cannot convert jp2 to jpg

Post by kasperite »

Hi

I am trying to convert an image from jp2 to jpg but getting this error Aborted (core dumped). The version I have is 6.8.9-0. I have successfully convert all other images except this one. Can anyone suggest why the error occured?I attached a stack trace when running convert command:

Code: Select all

2015-09-02T13:34:19+12:00 0:00.000 0.000u 6.8.9 Configure convert[12155]: utility.c/ExpandFilenames/944/Configure
  Command line: convert {-debug} {all} {/tmp/hires-stream20150902-7560-1txfpbv.jp2} {something.jpg}
2015-09-02T13:34:19+12:00 0:00.000 0.000u 6.8.9 Configure convert[12155]: configure.c/GetConfigureOptions/679/Configure
  Searching for configure file: "/usr/share/ImageMagick-6/coder.xml"
2015-09-02T13:34:19+12:00 0:00.000 0.000u 6.8.9 Configure convert[12155]: configure.c/GetConfigureOptions/679/Configure
  Searching for configure file: "/usr/lib/ImageMagick-6.8.9//config-Q16/coder.xml"
2015-09-02T13:34:19+12:00 0:00.000 0.000u 6.8.9 Configure convert[12155]: configure.c/GetConfigureOptions/679/Configure
  Searching for configure file: "/usr/etc/ImageMagick-6/coder.xml"
2015-09-02T13:34:19+12:00 0:00.000 0.000u 6.8.9 Configure convert[12155]: configure.c/GetConfigureOptions/679/Configure
  Searching for configure file: "/usr/share/doc/ImageMagick-6/coder.xml"
2015-09-02T13:34:19+12:00 0:00.000 0.000u 6.8.9 Configure convert[12155]: configure.c/GetConfigureOptions/679/Configure
  Searching for configure file: "/export/home/developer/.config/ImageMagick/coder.xml"
2015-09-02T13:34:19+12:00 0:00.000 0.000u 6.8.9 Configure convert[12155]: configure.c/GetConfigureOptions/679/Configure
  Searching for configure file: "/export/home/developer/.magick/coder.xml"
2015-09-02T13:34:19+12:00 0:00.000 0.000u 6.8.9 Configure convert[12155]: coder.c/LoadCoderCache/795/Configure
  Loading coder configuration file "/usr/etc/ImageMagick-6/coder.xml" ...
2015-09-02T13:34:19+12:00 0:00.000 0.000u 6.8.9 Module convert[12155]: module.c/OpenModule/1268/Module
  Searching for module "JP2" using filename "jp2.la"
2015-09-02T13:34:19+12:00 0:00.000 0.000u 6.8.9 Module convert[12155]: module.c/GetMagickModulePath/554/Module
  Searching for coder module file "jp2.la" ...
2015-09-02T13:34:19+12:00 0:00.000 0.000u 6.8.9 Module convert[12155]: module.c/OpenModule/1277/Module
  Opening module at path "/usr/lib/ImageMagick-6.8.9//modules-Q16/coders/jp2.la"
2015-09-02T13:34:19+12:00 0:00.000 0.000u 6.8.9 Module convert[12155]: module.c/OpenModule/1304/Module
  Method "RegisterJP2Image" in module "JP2" at address 0x7fde44f46a20
2015-09-02T13:34:19+12:00 0:00.000 0.000u 6.8.9 Module convert[12155]: module.c/OpenModule/1318/Module
  Method "UnregisterJP2Image" in module "JP2" at address 0x7fde44f469e0
2015-09-02T13:34:19+12:00 0:00.000 0.000u 6.8.9 Policy convert[12155]: policy.c/IsRightsAuthorized/574/Policy
  Domain: Path; rights=Read; pattern="/tmp/hires-stream20150902-7560-1txfpbv.jp2" ...
2015-09-02T13:34:19+12:00 0:00.000 0.000u 6.8.9 Blob convert[12155]: blob.c/OpenBlob/2540/Blob
    read 3 magic header bytes
2015-09-02T13:34:19+12:00 0:00.000 0.000u 6.8.9 Resource convert[12155]: resource.c/AcquireMagickResource/279/Resource
  Map: 142KB/139KiB/141.59GiB
2015-09-02T13:34:19+12:00 0:00.000 0.000u 6.8.9 Resource convert[12155]: resource.c/RelinquishMagickResource/862/Resource
  Map: 142KB/0B/141.59GiB
2015-09-02T13:34:19+12:00 0:00.000 0.000u 6.8.9 Cache convert[12155]: cache.c/DestroyPixelCache/962/Cache
  destroy
2015-09-02T13:34:19+12:00 0:00.000 0.000u 6.8.9 Configure convert[12155]: configure.c/GetConfigureOptions/679/Configure
  Searching for configure file: "/usr/share/ImageMagick-6/magic.xml"
2015-09-02T13:34:19+12:00 0:00.000 0.000u 6.8.9 Configure convert[12155]: configure.c/GetConfigureOptions/679/Configure
  Searching for configure file: "/usr/lib/ImageMagick-6.8.9//config-Q16/magic.xml"
2015-09-02T13:34:19+12:00 0:00.000 0.000u 6.8.9 Configure convert[12155]: configure.c/GetConfigureOptions/679/Configure
  Searching for configure file: "/usr/etc/ImageMagick-6/magic.xml"
2015-09-02T13:34:19+12:00 0:00.000 0.000u 6.8.9 Configure convert[12155]: configure.c/GetConfigureOptions/679/Configure
  Searching for configure file: "/usr/share/doc/ImageMagick-6/magic.xml"
2015-09-02T13:34:19+12:00 0:00.000 0.000u 6.8.9 Configure convert[12155]: configure.c/GetConfigureOptions/679/Configure
  Searching for configure file: "/export/home/developer/.config/ImageMagick/magic.xml"
2015-09-02T13:34:19+12:00 0:00.000 0.000u 6.8.9 Configure convert[12155]: configure.c/GetConfigureOptions/679/Configure
  Searching for configure file: "/export/home/developer/.magick/magic.xml"
2015-09-02T13:34:19+12:00 0:00.000 0.000u 6.8.9 Configure convert[12155]: magic.c/LoadMagicCache/774/Configure
  Loading magic configure file "/usr/etc/ImageMagick-6/magic.xml" ...
2015-09-02T13:34:19+12:00 0:00.000 0.000u 6.8.9 Policy convert[12155]: policy.c/IsRightsAuthorized/574/Policy
  Domain: Coder; rights=Read; pattern="JP2" ...
2015-09-02T13:34:19+12:00 0:00.000 0.000u 6.8.9 Policy convert[12155]: policy.c/IsRightsAuthorized/574/Policy
  Domain: Path; rights=Read; pattern="/tmp/hires-stream20150902-7560-1txfpbv.jp2" ...
2015-09-02T13:34:19+12:00 0:00.000 0.000u 6.8.9 Blob convert[12155]: blob.c/OpenBlob/2540/Blob
    read 3 magic header bytes
2015-09-02T13:34:19+12:00 0:00.000 0.000u 6.8.9 Cache convert[12155]: cache.c/DestroyPixelCache/962/Cache
  destroy
2015-09-02T13:34:19+12:00 0:00.000 0.000u 6.8.9 Policy convert[12155]: policy.c/IsRightsAuthorized/574/Policy
  Domain: Path; rights=Read; pattern="/tmp/hires-stream20150902-7560-1txfpbv.jp2" ...
2015-09-02T13:34:19+12:00 0:00.000 0.000u 6.8.9 Blob convert[12155]: blob.c/OpenBlob/2540/Blob
    read 3 magic header bytes
2015-09-02T13:34:19+12:00 0:00.000 0.000u 6.8.9 Resource convert[12155]: resource.c/AcquireMagickResource/279/Resource
  Map: 142KB/139KiB/141.59GiB
2015-09-02T13:34:19+12:00 0:00.270 0.250u 6.8.9 Resource convert[12155]: resource.c/AcquireMagickResource/279/Resource
  Area: 4.32MB/4.32MB/152.03GB
2015-09-02T13:34:19+12:00 0:00.270 0.250u 6.8.9 Resource convert[12155]: resource.c/AcquireMagickResource/279/Resource
  Memory: 4.32MB/4.12MiB/70.794GiB
2015-09-02T13:34:19+12:00 0:00.270 0.250u 6.8.9 Cache convert[12155]: cache.c/OpenPixelCache/3601/Cache
  open /tmp/hires-stream20150902-7560-1txfpbv.jp2[0] (Heap Memory, 600x900 4.12MiB)
2015-09-02T13:34:19+12:00 0:00.330 0.320u 6.8.9 Resource convert[12155]: resource.c/RelinquishMagickResource/862/Resource
  Map: 142KB/0B/141.59GiB
2015-09-02T13:34:19+12:00 0:00.330 0.320u 6.8.9 Module convert[12155]: module.c/OpenModule/1268/Module
  Searching for module "JPEG" using filename "jpeg.la"
2015-09-02T13:34:19+12:00 0:00.330 0.320u 6.8.9 Module convert[12155]: module.c/GetMagickModulePath/554/Module
  Searching for coder module file "jpeg.la" ...
2015-09-02T13:34:19+12:00 0:00.330 0.320u 6.8.9 Module convert[12155]: module.c/OpenModule/1277/Module
  Opening module at path "/usr/lib/ImageMagick-6.8.9//modules-Q16/coders/jpeg.la"
2015-09-02T13:34:19+12:00 0:00.330 0.320u 6.8.9 Module convert[12155]: module.c/OpenModule/1304/Module
  Method "RegisterJPEGImage" in module "JPEG" at address 0x7fde44ae4d70
2015-09-02T13:34:19+12:00 0:00.330 0.320u 6.8.9 Module convert[12155]: module.c/OpenModule/1318/Module
  Method "UnregisterJPEGImage" in module "JPEG" at address 0x7fde44ae4ca0
2015-09-02T13:34:19+12:00 0:00.330 0.320u 6.8.9 Policy convert[12155]: policy.c/IsRightsAuthorized/574/Policy
  Domain: Coder; rights=Write; pattern="JPG" ...
2015-09-02T13:34:19+12:00 0:00.330 0.320u 6.8.9 Resource convert[12155]: resource.c/RelinquishMagickResource/862/Resource
  Map: 142KB/16EiB/141.59GiB
2015-09-02T13:34:19+12:00 0:00.330 0.320u 6.8.9 Policy convert[12155]: policy.c/IsRightsAuthorized/574/Policy
  Domain: Path; rights=Write; pattern="something.jpg" ...
Aborted (core dumped)
Thanks
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Cannot convert jp2 to jpg

Post by dlemstra »

Can you add a link to the image that is causing this exception? Can you reproduce the issue with the latest version of ImageMagick?
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
kasperite
Posts: 3
Joined: 2015-09-01T19:35:49-07:00
Authentication code: 1151

Re: Cannot convert jp2 to jpg

Post by kasperite »

Thanks, unfortunately, I cannot provide the image due to some restrictions. I did try latest version of imagemagick and got the image converted successfully.Sadly, I cannot install latest version of imagemagick on actual server either(due to some dependency issues). It's a production server.

Below is the image info. Can you see anything useful?

Code: Select all

Image: hires-stream20150902-7560-1txfpbv.jp2
  Format: JP2 (JPEG-2000 File Format Syntax)
  Mime type: image/jp2
  Class: DirectClass
  Geometry: 600x900+0+0
  Units: Undefined
  Type: TrueColor
  Endianess: Undefined
  Colorspace: sRGB
  Depth: 8-bit
  Channel depth:
    red: 8-bit
    green: 8-bit
    blue: 8-bit
  Channel statistics:
    Pixels: 540000
    Red:
      min: 0 (0)
      max: 255 (1)
      mean: 188.482 (0.739146)
      standard deviation: 86.24 (0.338196)
      kurtosis: -0.939191
      skewness: -0.856923
      entropy: 0.679903
    Green:
      min: 0 (0)
      max: 255 (1)
      mean: 162.552 (0.637458)
      standard deviation: 96.6032 (0.378836)
      kurtosis: -1.51792
      skewness: -0.382387
      entropy: 0.693339
    Blue:
      min: 0 (0)
      max: 255 (1)
      mean: 150.525 (0.590293)
      standard deviation: 103.836 (0.407201)
      kurtosis: -1.70295
      skewness: -0.200674
      entropy: 0.682364
  Image statistics:
    Overall:
      min: 0 (0)
      max: 255 (1)
      mean: 167.186 (0.655632)
      standard deviation: 95.8323 (0.375813)
      kurtosis: -1.38723
      skewness: -0.495248
      entropy: 0.685202
  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)
  Background color: white
  Border color: srgb(223,223,223)
  Matte color: grey74
  Transparent color: black
  Interlace: None
  Intensity: Undefined
  Compose: Over
  Page geometry: 600x900+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: JPEG2000
  Orientation: Undefined
  Properties:
    date:create: 2015-09-02T13:43:58+12:00
    date:modify: 2015-09-02T13:43:58+12:00
    signature: 1f53de29f54048aa336cfde4a06917bf99661fb7af1ab381a9b4d5b50823f4fb
  Artifacts:
    filename: hires-stream20150902-7560-1txfpbv.jp2
    verbose: true
  Tainted: False
  Filesize: 142KB
  Number pixels: 540K
  Pixels per second: 38.571GB
  User time: 0.000u
  Elapsed time: 0:01.000
  Version: ImageMagick 6.9.1-10 Q16 x86_64 2015-09-03 http://www.imagemagick.org
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Cannot convert jp2 to jpg

Post by fmw42 »

What version of the delegate library openjp2 are you using. There were some issues about that time. See http://www.imagemagick.org/script/changelog.php

2014-04-22 6.8.9-1 Cristy <quetzlzacatenango@image...>
Require OpenJP2 version 2.1.0 (opj_stream_set_user_data() method signature change between 2.0.0 and 2.1.0).
kasperite
Posts: 3
Joined: 2015-09-01T19:35:49-07:00
Authentication code: 1151

Re: Cannot convert jp2 to jpg

Post by kasperite »

gotcha, thanks for your help guys. The delegate version is 2.0.1. That's the issue
Post Reply