Module: MRTFU: Mass rename of titles, filenames, and URLs
jnash
Joined: 2004-08-02
Posts: 814 |
Posted: Sun, 2012-05-06 03:57 |
This module provides a method of mass renaming items in an album. It provides options for the title, filename, and URL renaming. Once installed, you'll have an option in the album 'options' menu called 'MRTFU album' Once you 'mrtfu' an album, a task will be created that, once run (from admin->maintenance), will perform the renames It generates a task to ensure that ALL items in the album can be renamed without timing out in the event of a LOT of child photos As with any user contributed module: Disclaimer: Please ensure that you have a GOOD, FULL BACKUP of your gallery and it's images. This module does a LOT to your database/files/structures. I take no liability in its operation or its fit for use. Download Via: Codex |
|
Posts: 814
Previous discussion that inspired module is here:
http://gallery.menalto.com/node/106274
Thanks to Rockbär for the inspiration!
Posts: 76
I have to thank YOU. Awesome, really! Unfortunately I don't want to crash my system, if it's still in beta. I'm not THAT expert :-D I hope someone else (maybe other devs) can test it out?
Posts: 814
I've removed the BETA tag as I've tested on three different Galleries now with no issues noted.
Should be good to go.
Posts: 76
Okay, I'll give it a shot!
btw: it's RockbÄr, not RockbAr ;-)
Rockbär = Rock-Bear
Rockbar ~ rockable
Posts: 76
That's an awesome plugin! I'd like to thank your for your great and helpfully work. It lives up to its promise. Thanx a million!
Posts: 76
I have changed a few times the options to one album. Suddenly in the maintenance the following message appears:
MAYBE (I'm not sure) I have add a space after the prefix like "picture " in 'Rename all album item's URL to'.
But I have no choice any longer - if I change the options again, it will add the tasks to the existing one (e.g. 50 pics in the album, now there are 150 in task list: "Complete the MRTFU task" ---> "150 (100%) items need to be mrtfu'd" So, no way to cancel it.
Posts: 76
Protocol:
Posts: 814
To fix: You'll need to go into your database (do you have phpmyadmin?) and empty out the table 'mrtfu_items'
I can fix this in the code going forward... (seems like one of the rules for kohana forge forms doesn't take into account trailing spaces... (rule valid_alpha_dash)
(also emptying 'messages' table will clear the yellow 'you have a task' line...)
Posts: 814
fixed with this update v3 in original post above...
Posts: 814
I know, but the 'ä' doesn't work for a lot of stuff... but I fixed it
Ich lebte in Deutschland für ein paar Jahre.
Aber, ist mein Deutsch nicht so gut.
Posts: 27300
Tried it out finally. Looks cool. Glad you figured out the task stuff as in a large album it might take some time on a slow system, having a task that can start over is great!
Now for a better/different name? or at least a codex page with some explanations.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 814
What?!?!? You don't like my name? MRTFU ? I agree it doesn't roll off the tongue, but I'm a geek...
It's ready for a codex if you want to make me a blank.
Posts: 27300
Great!
http://codex.gallery2.org/Gallery3:Modules:MRTFU
Redirected from:
http://codex.gallery2.org/Gallery3:Modules:mass_rename
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 76
Cool, really cool, love it, great work!
Posts: 814
Got all the kinks worked out then?
Posts: 76
Yes, it seems so. Maybe one suggestion for "rename all album item's title": if you choose "the item's tags" and there is no tag for this item an additional option would be nice, that renames the item's title also to the ID or a prefix. Otherwise you have to rename all the pictures to the ID (or the the prefix, whatever you want)... going to the admin dashboard, maintenance, starting the task, going back to the gallery, and restarting the menue for the tags. So a dropdown-menue next to "the item's tags" would be cool. Nothing important - the plugin is still awesome and works fantastic!
Posts: 814
It's an interesting idea, unfortunately, it would be an effort to incorporate the logic. It would be better if you tagged the 'untagged' photos, or renamed them manually. Or, do it twice, like you described, if a lot of photos.
Unfortunately, I think it's too much for the module to do.
Posts: 16
It'd be amazing if this module could pull selective EXIF fields to use for the renaming of the files/fields. I realize it'd be some work, just an idea for any future versions.
Posts: 814
What sort of fields are we thinking of?
Posts: 16
Good question. Ideally, I see any being available, but there are far too many possible fields to list on the form. What about relying on the user to know the name of the EXIF tag? So, if they want to use the exposure time, they would enter something like ExposureTime in the field. If they wanted to use two fields, maybe something like ExposureTime, FNumber. It might be possible to feed those right into the query using LIKE to match them. All the EXIF tag names are single word (no spaces) and CamelCase, which should simplify things slightly. If the user entered non-existent fields it could either do nothing, or throw a warning in the result.
I'm just throwing ideas around, there may be better ways of doing it. I'm also not sure how many fields could be appended. If the module looped through whatever the user entered, to discover them, there's probably no reason for a limit, aside from server load issues (if any).
Posts: 814
And for what option, the title, the url, the filename? Or all/any?
Posts: 16
Any/all would give the most flexibility. Personally, I care about URLs the least, but I could see others wanting them all to match.
Posts: 814
I'd have to think about this. I think with the exif tag, there are a lot of potentials for duplicate names that could arise during renaming...
Posts: 27300
I think that using ExposureTime, FNumber, BatteryLevel, MeteringMode.... (or any other common EXIF/IPTC field) to be the title, url or file-name would be a very small edge case.
If this is going into this module I vote for having this some option that has to be turned on and not on by default.
It just makes the UI cluttered and will make the user confused.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 16
There would have to be a parameter to keep it unique, too. You're right about that. Maybe the ID, or adding a sequential number, or something along those lines. The same issue is true of using tags though.
floridave, the way I proposed it, how would one additional field in each section clutter the UI? It might not even need a new field. One could use radio buttons to select what the field is used for, be it tags, EXIF, or custom string.
I don't think this is necessarily a "very small edge case", I think that anyone using the script for photography rather than image hosting could see the potential of it.
Posts: 814
I'm tending to agree. It's already cluttered a bit too much for my liking, and it seems that some of these are very unique requests.
I'll await for other input before tackling this. I thinks it's just too much for a single request. I'm sorry.
However, as with anything I do here, you're welcome to do all the modifications you'd like to!
Posts: 16
It's all good, I appreciate the discussion. I was trying to make a case for its use, not pushing you to code it, certainly not right away.
Part of my thinking is that EXIF can hold relevant descriptive info, artist info, that kind of thing, as well as the settings used. Might be good for pulling title data for people that organize their photos using EXIF.
Maybe I'll have a go at it if I can find the time. It shouldn't be that difficult, given that you've hammered out the process for applying the changes.
Posts: 27300
Isn't that what tags are for?
Mass Rename of Titles, Filenames, and URLs
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 16
Yeah, it is what tags are for, and it'd be great to pull tag info from EXIF, too - for people who set the info in their photos as part of their workflow. Why set it twice, and lose the data if the photo is used in other places than a Gallery?
Maybe what's needed is a comprehensive module specifically for handling "advanced" uses of EXIF, rather than packing it into this one.
Posts: 814
dn3: I agree that perhaps there is a better place for this. I too was looking at the exif module/libraries/etc., and seeing what could be done with it. (It's under review in the bug tracker to be extended/modified/updated) I think you're correct that with IPTC and EXIF tags, there are opportunities to use this data in lot's of areas within the gallery.
I'm hopeful this module will be a catalyst for others to do unique and interesting things as well!
I also appreciate the commentary. After all, that's what this community should be about.
Posts: 76
Similar in the plugin: Is there a way, to store pictures ALWAYS by standard with img-filename to the item's ID (like 12345.jpg) AND the Internet-URL to the item's ID?
Posts: 814
funny you should ask:
http://gallery.menalto.com/node/106509
Posts: 76
lol :-D