Renamer not functioning as the Vartoy predicts

Started by Damit, March 18, 2025, 10:56:46 PM

Previous topic - Next topic

Damit

I am trying to work with the renamer. I am including a place holder in my file names to replace with a variable.  I have tried (PS) and {PS}.  For some reason {PS} does not show in the file name in IMatch.  Nothing is displayed where the {PS} stands, so if I had {PS}-1234.jpg, in IMatch it shows up as -1234.jpg in the file name. This is very curious. So, I switched the place holder to (PS). That is not the problem, but I thought I would report this unpredictable behavior to perhaps find out why IMatch is removing the {PS}.

Whether I use {PS} or (PS) the issue I am having is the same.  In the renamer I have the first step as "Original File Name." Next I have a "Replace Text" with a variable step.  The Replace value is "(PS)" and the With value is

{File.Width|cast:int;math:div,{File.MD.JFIF::Main\3\XResolution\0|default:{File.MD.Exif::Main\282\XResolution\0}},1}" x {File.Height|cast:int;math:div,{File.MD.JFIF::Main\5\YResolution\0|default:{File.MD.Exif::Main\283\YResolution\0}},1}"

The file name is "(PS)-Ep10000xl-1500dpi-0108.tif"
The Replacement result is "3.8" x 2.9 _-Ep10000xl-1500dpi-0108.tif"
I would expect it to be "3.8" x 2.9"-Ep10000xl-15000dpi-0108.tif" for, according to the VarToy,

{File.Width|cast:int;math:div,{File.MD.JFIF::Main\3\XResolution\0|default:{File.MD.Exif::Main\282\XResolution\0}},1}" x {File.Height|cast:int;math:div,{File.MD.JFIF::Main\5\YResolution\0|default:{File.MD.Exif::Main\283\YResolution\0}},1}"

Should equal 3.8" x 2.9"

But, as you can see in my example, the Renamer is not including the inch sign (") and it adds an underscore (_).  I cannot figure out why, so I thought I would ask here. As always, any help would be greatly appreciated.

sybersitizen

#1
" is an illegal character in Windows filenames. { and } can be used in most cases, but it's better to avoid them.

Mario

Please stick to the official Windows file naming conventions. Do not use characters illegal for file names.
See https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file

Damit

Ahh! Excuse my ignorance. :-[ 
I see now that the " was the problem, but if renamer is going to reject it at the end of a variable, should it not in the middle, as well? Just wondering. It would have helped me figure it out, but I am glad you both clarified so quickly, as I need to figure this out before proceeding with naming my new scans. THANK YOU!!!!! 8)

By the way, is it possible to get a clarification on why IMatch is not displaying the {PS} in the beginning of the file name.  I checked the link Mario provided and { is not an illegal character.

Lastly, perhaps it may be a good idea to include that link or a short primer of naming conventions on the Renamer section so as to fool proof it more, because the fool still screwed it up.  Just a suggestion in case Mario thinks it may be a good idea.

Tveloso

Quote from: Damit on March 18, 2025, 11:36:41 PMBy the way, is it possible to get a clarification on why IMatch is not displaying the {PS} in the beginning of the file name.
It may be that the Renamer is trying to parse that as an IMatch Variable...(and since {PS} is an unknown Variable, the result is NULL)
--Tony