Page 1 of 1

Converting a .doc file fails, rewrites original

Posted: 2014-05-16T04:52:50-07:00
by laurent_csw
Hello all,

I'm having a problem with a specific use case of ImageMagick: the conversion of an MS Word document to a bitmap fails with a strange error, and furthermore, the original file is rewritten (with the same data) so its timestamp changes.

Here is the error:

Code: Select all

$ convert file.doc file.jpg
convert: unable to open file `file.doc': No such file or directory @ error/fpx.c/ReadFPXImage/268.
convert: no images defined `file.jpg' @ error/convert.c/ConvertImageCommand/3187.
Here is an extract of the execution where it shows the file being opened first read-only, then read-write, and rewritten:

Code: Select all

17269:  open("file.doc", O_RDONLY)                      = 3
17269:  lseek(3, 0, SEEK_SET)                           = 0
17269:  fstat(3, 0xFFFFFD7FFFDF5F00)                    = 0
17269:  fstat(3, 0xFFFFFD7FFFDF5E50)                    = 0
17269:  ioctl(3, TCGETA, 0xFFFFFD7FFFDF5EC0)            Err#25 ENOTTY
17269:  read(3, "D0CF11E0A1B11AE1\0\0\0\0".., 4096)     = 4096
17269:  lseek(3, 0xFFFFFFFFFFFFF018, SEEK_CUR)          = 24
17269:  close(3)                                        = 0
17269:  open("file.doc", O_RDWR)                        = 3
17269:  lseek(3, 0, SEEK_CUR)                           = 0
17269:  lseek(3, 0, SEEK_SET)                           = 0
17269:  fstat(3, 0xFFFFFD7FFFDF5E00)                    = 0
17269:  fstat(3, 0xFFFFFD7FFFDF5D50)                    = 0
17269:  ioctl(3, TCGETA, 0xFFFFFD7FFFDF5DC0)            Err#25 ENOTTY
17269:  read(3, "D0CF11E0A1B11AE1\0\0\0\0".., 4096)     = 4096
17269:  lseek(3, 0, SEEK_SET)                           = 0
17269:  read(3, "D0CF11E0A1B11AE1\0\0\0\0".., 4096)     = 4096
17269:  lseek(3, 0, SEEK_END)                           = 46080
17269:  lseek(3, 0, SEEK_CUR)                           = 46080
If the same ImageMagick is rebuilt without FPX support:

Code: Select all

$ convert file.doc file.jpg
convert: no decode delegate for this image format `FPX' @ error/constitute.c/ReadImage/501.
convert: no images defined `Intercultural_Sensitivity_Questionnaire.jpg' @ error/convert.c/ConvertImageCommand/3187.
The operation seems so basic, I don't see what I could be doing wrong?

It is ImageMagic 6.8.9-1, with libfpx 1.3.1-4, on Solaris 10 x86, built with GCC 4.9.
The issue appears with multiple unrelated .doc files.

If there's any more information I can provide, just ask.

Thanks in advance for any suggestion,

Laurent

Re: Converting a .doc file fails, rewrites original

Posted: 2014-05-16T05:10:21-07:00
by magick
We can reproduce the problem you posted and have a patch in ImageMagick 6.8.9-2 Beta available by sometime tomorrow. Thanks.

Re: Converting a .doc file fails, rewrites original

Posted: 2014-05-16T05:14:48-07:00
by laurent_csw
Thank you, much appreciated!

Laurent

Re: Converting a .doc file fails, rewrites original

Posted: 2014-05-19T01:18:06-07:00
by laurent_csw
Confirmed fixed with a build of the -2-20140517 beta. Thanks again!

Laurent