View Full Version : Image resize output path hash / number sign is converted to 1

13.05.2020, 02:23 PM
Hi! I am using i_view64.exe to do command-line resizing. I have a problem with the output path. When it contains # (hash / number sign) then the hash is converted to '1'. My command:

i_view64.exe "C:\input\image #2 40.jpg" /resize=(1600, 0) /silent /jpgq=80 /aspectratio /resample /convert="C:\output\image #2 40.jpg_Large.jpg" /ini="C:\path\to\ini"

In the output folder I am getting a file named "image 12 40.jpg_Large.jpg". Is this some kind of feature that I don't know about or is this a bug? I tried version 4.5 and 4.54.

Kuki Dent
13.05.2020, 04:25 PM
Irfanview uses the # sign as a placeholder for a counter. The number of #s is the number of the digits that will come out.
E.g. ### stands for 001 to 999.
I use this function to number screenshots.

13.05.2020, 10:25 PM
Thanks Kuki. That makes sense. Is there a way to escape the hash sign in output path? I use irfanview with files that I do not control (so filenames and their output path may contain arbitrary number of hash signs). Replacing the numbers back to hashes would be quite cumbersome in my case.

Kuki Dent
13.05.2020, 10:54 PM
I assume that this behaviour is hard coded in iview_32.exe/i_view64.exe, so there will be no way to escape this function. If possible, use a decent tool
to replace # with another sign, e.g. !. After using IrfanView you can then do it the other way round.
You may also write to Irfan Skiljan and ask if he has a more elegant solution. See Help - About for his e-mail adress.

14.05.2020, 12:19 PM
Thanks, I contacted Irfan and he directed me in the right direction - I run 2 replacements:
$ --> $$
# --> $#
(in the output path)
This seems to do the trick. $ is a kind of escape character it seems.

Kuki Dent
14.05.2020, 05:03 PM
Andy250, thank you for sharing Irfan's answer with us. I might help others wit a similar problem.

19.06.2020, 09:54 PM
This behavior was not in version 4.27 This is something that was added since that version. I upgraded to version 4.54 when I implemented Windows 10. This is giving me a real headache as I now have to rewrite all my scripts and all calls to irfanview in my applications. Is there some other switch in the command line to turn off this behavior?

Bhikkhu Pesala
19.06.2020, 10:01 PM
Either install 4.27 and use that, or contact Irfan Skiljan to see if he can offer any suggestions.

26.06.2020, 09:55 PM
There is a very handy option $N that when used in the /convert= string will duplicate the original file name without implementing the # substitution.

In this case you could do the following:

i_view64.exe "C:\input\image #2 40.jpg" /resize=(1600, 0) /silent /jpgq=80 /aspectratio /resample /convert="C:\output"$N"_Large.jpg" /ini="C:\path\to\ini"

Your result would be a file named "image #2_Large.jpg" in folder "C:\output"