Page 1 of 1

International symbols in path or file name cause errors

Posted: 2010-08-03T00:17:20-07:00
by shaggy
Hi. I have a problem with files, that have international symbols (russian, in my case) in path or file name.
OS Windows XP Pro Russian

I have two copy of the one file with different names: image.jpg and рисунок.jpg
And two copy of the one TIF file: image.tif and рисунок.tif

In ImageMagick-6.6.3-2(or 0)-Q8 i got errors:

Code: Select all

C:\Program Files\ImageMagick-6.6.3-Q8>mogrify -resize 50% C:\рисунок.jpg
mogrify: Empty input file `C:\рисунок.jpg' @ error/jpeg.c/EmitMessage/235.

C:\Program Files\ImageMagick-6.6.3-Q8>mogrify -resize 50% C:\рисунок.tif
mogrify: Cannot read TIFF header. `C:\рисунок.tif' @ warning/tiff.c/TIFFErrors/494
but

Code: Select all

C:\Program Files\ImageMagick-6.6.3-Q8>mogrify -resize 50% C:\image.jpg

C:\Program Files\ImageMagick-6.6.3-Q8>mogrify -resize 50% C:\image.tif
works fine. It is the same files, difference only in names with international symbols.

I try ImageMagick-6.5.1-Q8. I have no errors with

Code: Select all

C:\Program Files\ImageMagick-6.5.1-Q8>mogrify -resize 50% C:\рисунок.jpg
C:\Program Files\ImageMagick-6.5.1-Q8>mogrify -resize 50% C:\рисунок.tif
but it just NOT work. Silently failed.

I found an old version ImageMagick-5.5.7-Q8

Code: Select all

C:\Program Files\ImageMagick-5.5.7-Q8>mogrify -resize 50% C:\рисунок.jpg

C:\Program Files\ImageMagick-5.5.7-Q8>mogrify -resize 50% C:\рисунок.tif
mogrify: unknown field with tag 34665 (0x8769) ignored. (C:\Ёшёєэюъ.tif).
have warning with TIF, but both files succesfully converted.

Same issues i can see, if international symbols is in file path: "C:\рисунок\image.tif" or "C:\рисунок\image.jpg"

Re: International symbols in path or file name cause errors

Posted: 2010-09-02T07:17:59-07:00
by vacek37
I am second to that.
Version: ImageMagick 6.6.3-0 2010-07-01
Windows 7 64-bit English (no problem on Mac, tested with the same IM version on Snow Leopard)

If a file path contains non-latin characters IM commands do not work. I tested 'convert' and 'identify'.

Code: Select all

C:\test>identify.exe -verbose "c:\img\Печать\1\_MG_0012.jpg"
identify.exe: unable to open image `c:\img\??????\1\_MG_0012.jpg': Invalid argument @ error/blob.c/OpenBlob/2514.
By simply renaming the Russian folder "Печать" to its English translation we get everything OK

Code: Select all

C:\test>identify.exe -verbose "c:\img\print\1\_MG_0012.jpg"
Image: c:\img\print\1\_MG_0012.jpg
  Format: JPEG (Joint Photographic Experts Group JFIF format)
  Class: DirectClass
  Geometry: 3504x2336+0+0
  Resolution: 96x96
  Print size: 36.5x24.3333
  Units: PixelsPerInch
  Type: TrueColor
  Endianess: Undefined
  Colorspace: RGB
  Depth: 8-bit
.............
This bug is fantastically annoying, making ImageMagick useless for most international applications!

Re: International symbols in path or file name cause errors

Posted: 2010-09-02T09:06:58-07:00
by magick
We create a file, Печать.jpg, under Windows XP. We then typed this command:
  • identify -verbose Печать.jpg
and ImageMagick found the file and identified it as expected. Next we created a folder, Печать, and placed Печать.jpg in it. This command worked as well
  • identify -verbose Печать/Печать.jpg
ImageMagick does display the filename as question marks in the output. We'll look into fixing that problem.

We're using ImageMagick-6.6.3-10.

Re: International symbols in path or file name cause errors

Posted: 2010-09-03T12:01:23-07:00
by Drarakel
Does ImageMagick really fully support Unicode on Windows?
I would have thought that such special characters only work if the Windows installation itself is set to the needed codepage.(?)
So, for shaggy (as he uses a russian Windows), it should work (theoretically). But with other Windows versions?

I'm currently using IM v6.6.3-10 Q16, on a german Windows XP. I set my console to codepage 65001 and the "Lucida Console" font.
Windows commands and certain tools that support unicode do work:

Code: Select all

E:\Temp>dir t-Печать\test.jpg
...
03.09.2010  20:47            43.693 test.jpg

Code: Select all

E:\Temp>exf -fp t-Печать\test.jpg
dd6ea32a811c7de53d863f34c5cee436 *E:\Temp\t-Печать\test.jpg
With IM, I'm getting the same errors as vacek37:

Code: Select all

E:\Temp>identify t-Печать\test.jpg
Magick: unable to open image `t-??????\test.jpg': Invalid argument @ error/blob.c/OpenBlob/2517.
@magick: What Windows version did you use for your test?