Magic Lantern Forum

Developing Magic Lantern => Feature Requests => Topic started by: Shizuka on October 20, 2012, 08:26:32 PM

Title: Custom File Prefixes
Post by: Shizuka on October 20, 2012, 08:26:32 PM
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.
Title: Re: Custom File Prefixes
Post by: 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
Title: Re: Custom File Prefixes
Post by: ..::T3::.. on November 28, 2012, 09:36:38 AM
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...
Title: Re: Custom File Prefixes
Post by: Shizuka on November 28, 2012, 09:57:34 AM
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.
Title: Re: Custom File Prefixes
Post by: 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.
Title: Re: Custom File Prefixes
Post by: Shizuka on November 29, 2012, 08:20:20 AM
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.
Title: Re: Custom File Prefixes
Post by: 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.
Title: Re: Custom File Prefixes
Post by: scrax on January 05, 2013, 11:00:48 PM
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,
Title: Re: Custom File Prefixes
Post by: a1ex on January 05, 2013, 11:32:40 PM
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);