Image File Name Assignation - Script Writing - CHDK Forum

Image File Name Assignation

  • 5 Replies
  • 6886 Views
Image File Name Assignation
« on: 21 / September / 2010, 09:47:07 »
Advertisements
Hi

Just got an ixus 70 and have installed CHDK.

I want to start scripting as I have an idea for an application and was wondering whether it is possible to influence the file name that the camera saves images under?

If so, would something bad happen if you tried to saved over one image with another using the same name?

Thanks in advance,

Nathan

*

Offline reyalp

  • ******
  • 14121
Re: Image File Name Assignation
« Reply #1 on: 21 / September / 2010, 12:50:26 »
Hi

Just got an ixus 70 and have installed CHDK.

I want to start scripting as I have an idea for an application and was wondering whether it is possible to influence the file name that the camera saves images under?
Not the files created by the camera. We do have the ability to delete and rename.
Don't forget what the H stands for.

Re: Image File Name Assignation
« Reply #2 on: 21 / September / 2010, 15:54:34 »
Ahhh.... interesting - please tell me how to rename....?

Also - what about propid 117 - 'File numbering (continuous=0, Auto Reset=1)' according to DanielF's ver helpful 'uBASIC' user guide.

*

Offline reyalp

  • ******
  • 14121
Re: Image File Name Assignation
« Reply #3 on: 21 / September / 2010, 16:44:01 »
Ahhh.... interesting - please tell me how to rename....?

Also - what about propid 117 - 'File numbering (continuous=0, Auto Reset=1)' according to DanielF's ver helpful 'uBASIC' user guide.
This is the same as the canon number options in the menu, which should be described in your camera manual.

To rename in CHDK, you would have to use a lua http://chdk.wikia.com/wiki/LUA script with os.rename.

A couple things to know
- if a file already exists with the name you want to rename to, you must delete it first. Failing to do so may corrupt your filesystem. Attempting to "move" a file to a different directory with rename can have the same effect.
- the camera sometimes gets a bit confused by file changes made through CHDK. I'm not sure if there would be any problem rename image files, you'd have to experiment and find out.
Don't forget what the H stands for.


*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: Image File Name Assignation
« Reply #4 on: 21 / September / 2010, 16:45:48 »
Ahhh.... interesting - please tell me how to rename....?
os.rename() in Lua: http://chdk.wikia.com/wiki/LUA#LUA_standard_libraries:_io.2C_os_and_string

But do note that renamed files will not be visible in play mode (until you restart the camera, and not even then if you use non-standard names -- also, before you reboot the old file names will be shown as broken photos in play mode because file renaming just doesn't make the camera firmware fully aware of what you've done) and they may not be available via normal USB PTP PC connection either.

Quote
Also - what about propid 117 - 'File numbering (continuous=0, Auto Reset=1)' according to DanielF's ver helpful 'uBASIC' user guide.

That's probably something you can find a setting for in Canon's menus... try searching the Canon camera users' manual if you can't...

Re: Image File Name Assignation
« Reply #5 on: 21 / September / 2010, 17:03:49 »
oh righty!

Thanks guys!

I will post up my app if/when completed....

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal