error/jpeg.c/JPEGErrorHandler/318 since 6.8.1-5

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.
Post Reply
freakout
Posts: 6
Joined: 2013-01-04T04:31:07-07:00
Authentication code: 6789

error/jpeg.c/JPEGErrorHandler/318 since 6.8.1-5

Post by freakout »

with some lightroom created images i get:
[axel@bongo jpgs]$ /opt/imagic/bin/identify d0508_scotld/d0508_scotld_001.jpg
identify: Empty input file `d0508_scotld/d0508_scotld_001.jpg' @ error/jpeg.c/JPEGErrorHandler/318.
up to 6.8.1-3 no problems - i did not install 6.8.1-4.
problem is since 6.8.1-5 and above.
images are correct and can be opened with various other software
broken image can be downloaded here: Image
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: error/jpeg.c/JPEGErrorHandler/318 since 6.8.1-5

Post by magick »

Your image converts / identifies for us without complaint. ImageMagick libraries are now decorated with the quantum depth, so instead of libMagickCore.so, we get libMagickCore-Q16.so. Its possible you have a conflict with an older install of ImageMagick and the new version. Try a clean install and see if the problem persists.
freakout
Posts: 6
Joined: 2013-01-04T04:31:07-07:00
Authentication code: 6789

Re: error/jpeg.c/JPEGErrorHandler/318 since 6.8.1-5

Post by freakout »

i use a complete stack of self-compiled software - everything runs on most recent stable versions:

Code: Select all

[axel@bongo axel]$ ldd /opt/imagic/bin/identify
        libMagickCore-Q16.so.7 => /opt/imagic/lib/libMagickCore-Q16.so.7 (0xb7bba000)
        libMagickWand-Q16.so.7 => /opt/imagic/lib/libMagickWand-Q16.so.7 (0xb7a8e000)
        libtiff.so.5 => /opt/tiff/lib/libtiff.so.5 (0xb7a29000)
        libjpeg.so.62 => /opt/jpeg/lib/libjpeg.so.62 (0xb7a09000)
        libpng12.so.0 => /opt/png/lib/libpng12.so.0 (0xb79dc000)
        libfontconfig.so.1 => /opt/fontconfig/lib/libfontconfig.so.1 (0xb79a6000)
        libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0xb795d000)
        libbz2.so.1 => /opt/bzip2/lib/libbz2.so.1 (0xb794d000)
        libpango-1.0.so.0 => /opt/pango/lib/libpango-1.0.so.0 (0xb78f8000)
        libgmodule-2.0.so.0 => /opt/glib2/lib/libgmodule-2.0.so.0 (0xb78f4000)
        librt.so.1 => /lib/librt.so.1 (0xb78e2000)
        libgobject-2.0.so.0 => /opt/glib2/lib/libgobject-2.0.so.0 (0xb789b000)
        libgthread-2.0.so.0 => /opt/glib2/lib/libgthread-2.0.so.0 (0xb7899000)
        libffi.so.6 => /opt/libffi/lib/libffi.so.6 (0xb7892000)
        libglib-2.0.so.0 => /opt/glib2/lib/libglib-2.0.so.0 (0xb7767000)
        libintl.so.8 => /opt/gettext/lib/libintl.so.8 (0xb775d000)
        libc.so.6 => /lib/libc.so.6 (0xb7639000)
        libxml2.so.2 => /opt/xml/lib/libxml2.so.2 (0xb7514000)
        libdl.so.2 => /lib/libdl.so.2 (0xb7511000)
        libz.so.1 => /opt/zlib/lib/libz.so.1 (0xb74fc000)
        libpthread.so.0 => /lib/libpthread.so.0 (0xb74ab000)
        libm.so.6 => /lib/libm.so.6 (0xb7489000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb746f000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0xb7f88000)
[axel@bongo axel]$ /opt/imagic/bin/identify tmp/d0508_scotld_001.jpg
identify: Empty input file `tmp/d0508_scotld_001.jpg' @ error/jpeg.c/JPEGErrorHandler/318.
What can i do to track down the issue?

Thanks for your help.
freakout
Posts: 6
Joined: 2013-01-04T04:31:07-07:00
Authentication code: 6789

Re: error/jpeg.c/JPEGErrorHandler/318 since 6.8.1-5

Post by freakout »

i have tracked down every single diff between 6.8.1-3 and 6.8.1-5 and have identified the diff which causes the trouble for me:

Code: Select all

diff -ur ImageMagick-6.8.1-5/magick/blob.c ImageMagick-6.8.1-3/magick/blob.c
--- ImageMagick-6.8.1-5/magick/blob.c   Thu Dec 27 01:56:28 2012
+++ ImageMagick-6.8.1-3/magick/blob.c   Fri Dec 21 03:42:16 2012
@@ -2528,8 +2525,7 @@
 #endif
             (void) ResetMagickMemory(magick,0,sizeof(magick));
             count=fread(magick,1,sizeof(magick),image->blob->file_info.file);
-            (void) fseek(image->blob->file_info.file,(off_t) -count,SEEK_CUR);
-            (void) fflush(image->blob->file_info.file);
+            (void) rewind(image->blob->file_info.file);
             (void) LogMagickEvent(BlobEvent,GetMagickModule(),
                "  read %.20g magic header bytes",(double) count);
 #if defined(MAGICKCORE_ZLIB_DELEGATE)
when i backpatch this single diff in 6.8.1-5 i get a working binary.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: error/jpeg.c/JPEGErrorHandler/318 since 6.8.1-5

Post by magick »

Does this patch work for you?

Code: Select all

           (void) fseek(image->blob->file_info.file,-((off_t) count),SEEK_CUR);
           (void) fflush(image->blob->file_info.file);
freakout
Posts: 6
Joined: 2013-01-04T04:31:07-07:00
Authentication code: 6789

Re: error/jpeg.c/JPEGErrorHandler/318 since 6.8.1-5

Post by freakout »

Yes - this works for me! Thanks a lot.
omega13a
Posts: 2
Joined: 2013-01-05T13:16:48-07:00
Authentication code: 6789

Re: error/jpeg.c/JPEGErrorHandler/318 since 6.8.1-5

Post by omega13a »

Works for me as well. 8) I wasted all morning thinking my problems with ImageMagick after upgrading to 6.8.1-8 from 6.8.1-3 were caused by some catastrophic system failure on my webserver before I found this thread. :oops:
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: error/jpeg.c/JPEGErrorHandler/318 since 6.8.1-5

Post by magick »

ImageMagick 6.8.1-9, the current release, includes this patch.
broucaries
Posts: 467
Joined: 2008-12-21T11:51:10-07:00

Re: error/jpeg.c/JPEGErrorHandler/318 since 6.8.1-5

Post by broucaries »

Hi,

I really think gnulib could be at help here.

bastien
Post Reply