supplierdeeply

Custom file naming

  • 7 Replies
  • 2321 Views
Custom file naming
« on: 28 / March / 2008, 13:36:22 »
Advertisements
I'm not sure if this has been requested, I did some searching and didn't find anything.  Is there a way to create custom file names?  I have 4 CHDK capable cameras (all purchased since CHDK released), and I don't want the file names to overlap.  Can CHDK create a custom name like SD850_IMG00001.jpg?

*

Offline wontolla

  • ****
  • 413
  • S3 & G9 & A720
Re: Custom file naming
« Reply #1 on: 28 / March / 2008, 14:49:26 »
Well, C language has the rename() function. I guess it is just a matter of writing something to do that. It has been in the requests list from a long time. May be developers thing this is so easy to do in the PC that is not priority to add a rename feature in CHDK.

If you have basic programming skills and don't want to wait, you can give it a try.

I'd like to jump and say "I can do it" but I have at least 2 unfinished projects.

*

Offline GrAnd

  • ****
  • 916
  • [A610, S3IS]
    • CHDK
Re: Custom file naming
« Reply #2 on: 28 / March / 2008, 15:10:41 »
But with a custom name you won't be able to copy that files without cardreader or even to view them in the camera.
CHDK Developer.

*

Offline jetzt

  • ****
  • 316
  • [A710IS,(SD200)]
Re: Custom file naming
« Reply #3 on: 28 / March / 2008, 15:59:05 »
Maybe a menu-entry, which you use just before downloading.

Is it possible to do a renameing after exif-fields?
Cause I would like to rename my Images after total shot couter, so something like IMG_12822.JPG.

I think that isn't too hard, if's like that I can offer my help / try it myself.
Would I have to code a "read_exif()" myself or is there already something like that.
(It has to be somewhere, cause in Review-mode there are the values, but has it been found? Can't look for it myself right now, as I don't have an IDA-PC here.)

Happy coding jetzt


*

Offline GrAnd

  • ****
  • 916
  • [A610, S3IS]
    • CHDK
Re: Custom file naming
« Reply #4 on: 28 / March / 2008, 17:06:13 »
Is it possible to do a renameing after exif-fields?
Cause I would like to rename my Images after total shot counter, so something like IMG_12822.JPG.

Some years ago I wrote the plugin for FAR manager which allows to do such renaming during the copying files from the camera.



Code: [Select]
Format of rename template

    Plugin has an automatic rename/move feature while copying files from camera
based on defined template with using Exif data.
    Template may contain any text and variables for substitution. Variable is any
sequence of characters between percent characters "%".
    Template may consist of absolute or relative path and/or optional file name.
If template ends with "\", the source file will be just moved to destination.
Otherwise, file will be renamed and original extension will be preserved.


 Generally, variables have the following format:
 %<VARIABLE_NAME>[:OPTIONS]%

 All variables is case insensitive.


 Supported Options:

 L - convert substitute value to lowercase;
 U - the same, but to uppercase;
 <NUMBER> - trim substitute value to defined numbers of characters.
 Note: The variable DateTime may contain two sections of options.


 Supported Variables:

 Make
    Title of manufacturer of camera. For Canon's cameras it's "Canon".

 Model
    Title of model number of camera, for example "Canon PowerShot A60".

 DateTime
    Date/Time of shoot. This format differs from other variables:
    %DateTime[:[FORMAT][:OPTIONS]]%
 
    If parameter "FORMAT" is omitted, the result will be as "YYYY_MM_DD HH_MM_SS".
    The next format specifiers are allowed:
      YY    - year, two digits (04)
      YYYY  - year, four digits (2004)
      M     - month number, one or two digits (1)
      MM    - month number, two digits with leading zero (01)
      MMM   - month abbreviation (Jan)
      MMMM  - month full name (January)
      D     - day, one or two digits (7)
      DD    - day, two digits with leading zero (07)
      DDD   - day of week, abbreviation (Wed)
      DDDD  - day of week, full name (Wednesday)
      H     - hour, one or two digits (9)
      HH    - hour, two digits with leading zero (09)
      N     - minute, one or two digits (3)
      NN    - minute, two digits with leading zero (03)
      S     - second, one or two digits (4)
      SS    - second, two digits with leading zero (04)
    All other characters transfers without changing.
    Ex.: %DateTime:D-MM-YY(DDD) at H-NN-SS%  ->  "7-01-04(Wed) at 9-03-04".

 ExpTime
    Exposure time (reciprocal of shutter speed) at format X/Y, for example "[email protected]@60".

 FNumb
    The actual F-number (F-stop) of lens when the image was taken, for example "2.8".

 Tv
    Shutter speed. The same as ExpTime, but in seconds. For example "0.0333".

 Av
    The actual aperture value of lens when the image was taken (in APEX format),
for example "5.0".

 EBias
    Exposure bias (compensation) value of taking picture, for example "-0.3".

 FocalLen
    Focal length of lens used to take image (in mm), for example "14.72".

 Width
    Width of picture in pixels, for example "1600".

 Height
    Height of picture in pixels, for example "1200".

 ISO
    ISO value (CCD sensitivity equivalent to Ag-Hr film speedrate).
Can be "Auto", "50", "100", "200", "400".

 WB
    White balance used while shooting. Can be "Auto", "Sunny", "Cloudy",
"Tungsten", "Fluorescent", "Flash", "B&W", "Shade", "Custom".
 
 Flash
    Flash mode. Can be "Auto", "Off", "On", "RedEye", "SlowSynchro",
"Auto&RedEye", "On&RedEye", "External".

 FBias
   Flash bias value, for example "-0.3".

 ExpMode
    Exposure mode. Can be "Auto", "Landscape", "FastShutter", "SlowShutter",
"Night", "Sepia", "Portrait", "Sports", "Macro", "PanFocus", "Program",
"Manual", "TvPriority", "AvPriority", "A-DEP", "B&W".

 MeterMode
    Metering mode of exposition evaluating. Can be "Evaluative", "Partial", "CenterWeighted".

 Macro
    Macro mode flag. Can be "Normal" and "Macro".

 ImageSize
    Image size relative to camera possibility. Can be "Large", "Medium", "Small".

 Quality
    Image Quality (jpeg compression). Can be "Normal", "Fine", "Superfine", "RAW".

 SeqNumb
    Sequence number (if in a continuous burst). For normal shooting it's always "1".

 Firmware
    Firmware version in camera, for example "Firmware Version 1.0".

 Owner
    Camera owner, for example "Jonh Brown".

 ImageNumb
    Internal image number used of camera while continuous numeration.
For example, for shot number 6732 it will be "1676732".

 FullNumb
    Full five-place shot number, decoded from previous value.

 Prefix
    First four characters of source filename, for example "IMG-".


 Template samples:
 
 %Width%x%Height%-%FullNumb%-%Quality:1L%-F%FNumb%
 Only to rename file after copying.
 Example of result: "1600x1200-16674-s-F2.8.JPG".

 %DateTime:YYYY-MM-DD%\%DateTime:HH-NN-SS%
 Create in destination folder named as creation date of file and move renamed file into.
 Example of result: "2004-01-14\18-25-37.JPG".

 D:\FOTOS\%DateTime:YYYY-MM-DD%\%DateTime:HH-NN-SS%
 The same as previous example, but destination always is "D:\FOTOS\".
 Example of result: "D:\FOTOS\2004-01-14\18-25-37.JPG".

 %Model:U%\
 Group files by folders, based on uppercased title of model number.
 Example of result: "CANON POWERSHOT S50\IMG-0459.JPG".
« Last Edit: 28 / March / 2008, 17:14:40 by GrAnd »
CHDK Developer.

*

Offline jetzt

  • ****
  • 316
  • [A710IS,(SD200)]
Re: Custom file naming
« Reply #5 on: 30 / March / 2008, 13:03:32 »
Great! That's what I call a plugin.
 :D

Edit: Almost forgot: thanks very much!

Re: Custom file naming
« Reply #6 on: 05 / October / 2009, 11:21:27 »
Is it possible to make Canon use EXIF data to create photos with names:
YYYYMMDD-hhmmss-IMG_1234.jpg
instead of simple IMG_1234.jpg?

I know I can use the FAR patch or jhead, Exifer, Total Commander or other application but it would be much easier to have files ALREADY recorded with such a name.

*

Offline reyalp

  • ******
  • 10944
Re: Custom file naming
« Reply #7 on: 05 / October / 2009, 17:05:08 »
Is it possible to make Canon use EXIF data to create photos with names:
YYYYMMDD-hhmmss-IMG_1234.jpg
instead of simple IMG_1234.jpg?
Possible in theory ? Sure.

Possible with the code currently available in CHDK ? not really. On dryos cameras, we don't even have long filename support.
Don't forget what the H stands for.


 

Related Topics