Custom File Prefixes

Started by Shizuka, October 20, 2012, 08:26:32 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Shizuka

From the patch from http://www.magiclantern.fm/forum/index.php?topic=3085.0 :
+static char file_prefix[8] = "IMG_";
+PROP_HANDLER(PROP_FILE_PREFIX)
+{
+    snprintf(file_prefix, sizeof(file_prefix), "%s", (const char *)buf);
+}
+
+int hdr_increment_file_prefix()
+{
+    if (hdr_counter < 0) return 0; // you have poured alcohol into the CPU?
+    hdr_counter++;
+    if (hdr_counter >= 1000) return 0; // you took 1000 bracketed shots?!
+   
+    if (hdr_counter < 100) snprintf(hdr_prefix, 8, "B%02d_", hdr_counter);
+    else snprintf(hdr_prefix, 8, "B%03d", hdr_counter);
+
+    while (lens_info.job_state) msleep(100);
[b]+    prop_request_change(PROP_FILE_PREFIX, hdr_prefix, 8);[/b]
+    hdr_file_prefix_dirty = 1;
+}

The 550D doesn't support FIO_RenameFile, but from the above code, it seems like it's possible to customize the file prefix of captured images before capture.

Can the replacement of IMG_ and _MG_ with arbitrary 4-character strings be added as a feature?
This is a feature only found in the high end Canon cameras and makes file management much easier (in case of multiple non-1D / 5D3 cameras).

Not sure how this would affect movies (MVI_) or whatever else is implemented in the firmware.

1%


..::T3::..

Hey 1%

THX a lot!!!!

Last weekend I thought about, this would be a really nice feature. After I got lost in I big HDR session...

So, it should be available in the next nightly build, right?

Already curious to test...

Shizuka

Quote from: 1% on November 28, 2012, 06:00:30 AM
This would help HDR. I always forget what goes with what.

The patch works.

https://bitbucket.org/OtherOnePercent/tragic-lantern/changeset/a98233251397bc3029b65a35b2ac27aa23e76460

Please note that I did not write this patch, so credit appropriately.

Actually I was hoping the file prefix can be set arbitrarily, ie. for example, from a file called A:\DCIMPRFX.TXT containing the four bytes "T2I_", as we don't have alphanumeric input yet.

1%

Yea, A1ex's patch is much longer in the other thread. But it names brackets like B01 and the next one B02, etc.  There is an on screen keyboard and such but this works for me.

*Its in my build for now.  If you want it in ML tree, ask. Everyone was afraid to test it and thread died.

Shizuka

Quote from: 1% on November 28, 2012, 04:22:08 PM
Yea, A1ex's patch is much longer in the other thread. But it names brackets like B01 and the next one B02, etc.  There is an on screen keyboard and such but this works for me.

*Its in my build for now.  If you want it in ML tree, ask. Everyone was afraid to test it and thread died.

I'll test it.

1%

Should this go in main repo? I've tested it on 600D and its worked well. Will have to add it to 6D.

scrax

Quote from: 1% on January 05, 2013, 09:44:44 PM
Should this go in main repo? I've tested it on 600D and its worked well. Will have to add it to 6D.
I've tested it too and worked for my 600D,
I'm using ML2.3 for photography with:
EOS 600DML | EOS 400Dplus | EOS 5D MLbeta5- EF 100mm f/2.8 USM Macro  - EF-S 17-85mm f4-5.6 IS USM - EF 70-200mm f/4 L USM - 580EXII - OsX, PS, LR, RawTherapee, LightZone -no video experience-

a1ex

Not yet, it has a couple of subtle bugs.

For example, this will interfere with long brackets (e.g. 9x1 RAW on 60D): while (lens_info.job_state) msleep(100);