Wildcards with non-ascii paths

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
acetonitril
Posts: 1
Joined: 2015-03-31T16:28:23-07:00
Authentication code: 6789

Wildcards with non-ascii paths

Post by acetonitril »

Hi,

on Windows imagemagick doesn't expand input filenames with 'file meta-characters' * or ?, if there are non-english characters in the path to the working directory and no relative path is given with the input filenames.

An example:

C:\temp\test>identify "файл*.jpg"
N"?°???>0.jpg JPEG 500x645 500x645+0+0 8-bit sRGB 102KB 0.000u 0:00.000
N"?°???>1.jpg[1] JPEG 500x417 500x417+0+0 8-bit sRGB 60.9KB 0.000u 0:00.001

works ok (apart from messed filenames in the output), but if I add a russian character to the directory name, then

C:\temp\testЙ>identify "файл*.jpg"
identify.exe: unable to open image `N"?°???>*.jpg': Invalid argument @ error/blob.c/OpenBlob/2675.

doesn't work, even if I give english names to the files ("file*.jpg").

A workaround is to add the relative path:

C:\temp\testЙ>identify ".\файл*.jpg"
.\N"?°???>0.jpg JPEG 500x645 500x645+0+0 8-bit sRGB 102KB 0.000u 0:00.000
.\N"?°???>1.jpg[1] JPEG 500x417 500x417+0+0 8-bit sRGB 60.9KB 0.000u 0:00.001


The same bug happens with convert.exe

I am on english windows 7 64bit
C:\temp\test>convert --version
Version: ImageMagick 6.9.0-10 Q16 x64 2015-02-28 http://www.imagemagick.org
vmr
Posts: 7
Joined: 2015-04-06T04:07:42-07:00
Authentication code: 6789

Re: Wildcards with non-ascii paths

Post by vmr »

Confirmed
No any tool is able to open file if path contains non ascii characters
Even if file names contin only "valid" latin characters
Example

Code: Select all

c:\photo\3\Папка>mogrify.exe -resize 600x600 *.jpg
mogrify.exe: unable to open image `*.jpg': Invalid argument @ error/blob.c/OpenBlob/2643.
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Wildcards with non-ascii paths

Post by dlemstra »

We can reproduce the issue and I just submitted a patch to our SVN repository to fix this. This will be fixed in ImageMagick 6.9.1-2
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
vmr
Posts: 7
Joined: 2015-04-06T04:07:42-07:00
Authentication code: 6789

Re: Wildcards with non-ascii paths

Post by vmr »

Hi
The similar issue, tool will fail if source or destination path contains non-ascii:

Code: Select all

mogrify.exe -resize 900x600   -path "c:\dev\src\prepare4web\test\белиберда два\web900x600\" "c:\dev\src\prepare4web\test\белиберда два\input.jpg"
mogrify.exe: UnableToOpenBlob `Р?Р?Р°\input.jpg': No such file or directory @ error/blob.c/OpenBlob/2695.
UPDATE:
I am using the following version:

Code: Select all

mogrify.exe -version
Version: ImageMagick 6.9.2-0 Q16 x86 2015-08-15 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC
Delegates (built-in): bzlib cairo freetype jng jp2 jpeg lcms lqr openexr pangocairo png ps rsvg tiff webp xml zlib
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Wildcards with non-ascii paths

Post by dlemstra »

Are you running this command in a batch file? And is the encoding of your batch file correct?
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Post Reply