#1 2006-12-04 15:43

renameUser1
Member
Registered: 2006-12-04
Posts: 3

Rename images from different cam's

I'd like to use ReNamer to rename photo's / images taken by different cam's.

The result should be:
1. only JPE, JPG, JPEG files should be renamed
2. the new filename should be yyyy-mm-dd@hh-mm-ss_shortcut of cam_model.jpg
3. duplicates should be extended by '_xx' (xx = 01, 02, 03..)

Like this:
IMAGE_10023.JPG -> 2005-12-20@22-22-23_A40.JPE
PICT_00001.JPE -> 2005-12-21@12-12-20_D7Hi.JPG

I tried this with ReNamer by the following rules
1. Replace All ".JPE" with ".JPG"
2. Insert ":EXIF_Date:yyyy-mmm-ddd@hh-nn-ss" as Prefix
3. Delete from Position 20 until the End (skip extension"
4. Insert "_:EXIF_Model:" as Suffix (before extension)
5. Remove all "Canon Powershot", DMC-", "DSC-" "iMage "

The result looks like
2005-05-12@22-12-22_A40.JPG

BUT - and here I need help:

First off all, i wasn't able to select only the JPE, JPG, JPEG -files. All other files are also listed.

Second:
All *.JPE - files will not be renamed to *.JPG
It seems that there is no constrain on the order of rules . (Because all the *jpe files get the name yyyy-mm-dd@hh-nn-ss_.JPE - just like the EXIF-mask)

And third:
I used the given pascal-script for rename dublicates, BUT i wasn't abel to put the iteration in front of the extension. The iteration is after the extension - like ".JPG (2)". I need it in a way like this "2005-12-12@20-22-12_A40_02.JPG"

Could you give me an advice?

Last edited by renameUser1 (2006-12-04 15:48)

Offline

#2 2006-12-05 18:44

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,367

Re: Rename images from different cam's

To add only JPE, JPG, JPEG files, use Add Folder dialog, and use *.JP* mask (with stars).  Alternatively, add all of your files into ReNamer, then use "Select by mask" option from context menu of a table and enter *.JP* mask, now invert the selection of files by pressing Ctrl+I, and then press Delete key to remove those files that don't match the mask.

If I understand correctly, you want to change JPG -> JPE and JPE -> JPG, right? And do nothing with JPEG? If you can clarify this, I will be able to write a small script that will do that task.

I fixed that problem in "Serialize duplicates" script, and adapted it for your needs. It will add suffix _02, _03, _xx (before extension) for all duplicated files. Script is below:

var
  Files: TStringsArray;

procedure Add(const S: WideString);
begin
  WideArraySetLength(Files, WideArrayLength(Files)+1);
  Files[WideArrayLength(Files)-1] := S;
end;

function Exists(const S: WideString): Boolean;
var I: Integer;
begin
  Result := False;
  for I:=0 to WideArrayLength(Files)-1 do
    if WideSameText(Files[i], S) then
      begin Result := True; Break; end;
end;

function PadNum(const Num, NewLength: Integer): string;
begin
  Result := IntToStr(Num);
  while Length(Result) < NewLength do
    Result := '0'+Result;
end;

var
  NewFileName: WideString;
  Counter: Integer;

begin
  Counter := 2;
  NewFileName := FileName;
  while Exists(NewFileName) do
    begin
    NewFileName := 
      WideExtractBaseName(FileName) +
      '_' + PadNum(Counter,2) + 
      WideExtractFileExt(FileName);
    Counter := Counter + 1;
    end;
  FileName := NewFileName;
  Add(FileName);
end.

Offline

#3 2006-12-05 20:59

renameUser1
Member
Registered: 2006-12-04
Posts: 3

Re: Rename images from different cam's

Hi den4b,

thanks a lot for the pascal script. It works lol:lol: fantastic !!

About the JPE-Question:
I want to rename all JPE (EXTENSION) files into JPG files.
I found out, that EXIF-Data could not be read from files with the extension JPE.
Changing the extension into JPG - solves this problem (BUT this is a problem
in general with Minolta-Image extension).

Do you have some hints for me how i can place a RULE to add only "*JP*" files (instead of ADD-Folder-Masks)
and
- how can force the rename of JPE-Files into JPG-Files before ReNamer starts with the other rules ?

Thanx a lot smile

Offline

#4 2006-12-06 16:57

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,367

Re: Rename images from different cam's

I have even more good news for you! smile

1) ReNamer will now treat JPE extension as JPEG format, so meta tags will work for JPE files, so you don't need to change their extension to JPG anymore. Download latest development version: ReNamerBeta.zip

2) There is a trick involved, if you want to rename only JPG, JPEG, JPE files in the table. You can use PascalScript to set new names of other files to their original names (or to empty names), in the very last rule. Below is the script that will do that:

var
  Ext: WideString;
begin
  Ext := WideUpperCase(WideExtractFileExt(FilePath));
  if (Ext <> '.JPG') and (Ext <> '.JPE') and (Ext <> '.JPEG') then
    FileName := WideExtractFileName(FilePath);
end.

Offline

#5 2006-12-07 20:01

renameUser1
Member
Registered: 2006-12-04
Posts: 3

Re: Rename images from different cam's

Fantastic - that's realy good news  lol:lol:
and thanks a lot for that excellent support

Offline

Board footer

Powered by FluxBB