You are not logged in.
Pages: 1
Hello, everyone.
I have some image files of comics and want to name it this way:
Name P### - for single page images;
Name P###-### - for double page images.
Want to choose the sequence's first number.
Thought that a script using file's WIDTH and HEIGHT values should do the trick, but doesn't know to use Pascal.
Really grateful since now for anyone that could help me.
Offline
It should be possible to do what you want using a combination of meta tags, serialize rule and PascalScript. However, what if the single-page images in some high quality files are bigger and in low-quality files are smaller? In such a case depending on the cutoff values the bigger images could be misinterpreted as double-page ones.
Offline
@Lukers18 Please, I think we are not understanding you corrrectly.
Could you detail a little bit more?
How are the current names, and what should become?
name -> new name
And what do the dimensions have to do with it?
Last edited by SafetyCar (2011-12-07 09:49)
If this software has helped you, consider getting your pro version. :)
Offline
It should be possible to do what you want using a combination of meta tags, serialize rule and PascalScript. However, what if the single-page images in some high quality files are bigger and in low-quality files are smaller? In such a case depending on the cutoff values the bigger images could be misinterpreted as double-page ones.
It doesn't happen in any circumstance.
Single paged images will ALWAYS be taller than large. - e.g. Width x Height
Double paged images will ALWAYS be larger than tall. - e.g. 2xWidth x Height
@Lukers18 Please, I think we are not understanding you corrrectly.
Could you detail a little bit more?
How are the current names, and what should become?
name -> new name
And what do the dimensions have to do with it?
Single paged:
Name > new name
no matter > 001.jpg
Double paged:
Name > new name
no matter > 001-002.jpg
The script should compare the dimensions to determine if it is single or double paged and apply the correct format to the name.
Offline
Single paged images will ALWAYS be taller than large. - e.g. Width x Height
Double paged images will ALWAYS be larger than tall. - e.g. 2xWidth x HeightSingle paged:
no matter > 001.jpgDouble paged:
no matter > 001-002.jpgThe script should compare the dimensions to determine if it is single or double paged and apply the correct format to the name.
For that description I think this should do it:
var
Ext, Ratio: WideString;
I: Integer;
function NextPage(): WideString;
begin
I := I + 1;
Result := IntToStr(I);
while length(Result)<3 do Result := '0' + Result;
end;
begin
Ratio := CalculateMetaTag(FilePath, 'Image_AspectRatio');
if (Ratio <> '') then
begin
Ext := WideExtractFileExt(FileName);
if (Ratio[1]='0') then
FileName := NextPage() + Ext
else
FileName := NextPage() + '-' + NextPage() + Ext;
end;
end.
If this software has helped you, consider getting your pro version. :)
Offline
Pages: 1