Renames some files to "None"

Bug #716309 reported by Aston Clulow
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pyRenamer
New
Undecided
Unassigned

Bug Description

When renaming images according to metadata, any image with no metadata (eg one that's been edited in GIMP) will be renamed to "None", rather than being skipped. I can't remember what happens if there's more than one image with no metadata, but I do remember it's not good!

Revision history for this message
André Ventura (afv) wrote :

Not only when there is no metadata but also when the file name pattern does not match.

Solution:

Edit the pyrenamer_filefuncs.py (at /usr/lib/python2.7/site-packages/pyrenamer/), adding this two lines to the "def replace_images(name, path, newname, newpath):" function:

----------
    if cameramodel != None: newname = newname.replace('{cameramodel}', cameramodel)
    else: newname = newname.replace('{cameramodel}', '')

+ if newname == "None":
+ return None, None

    # Returns new name and path
    newpath = get_new_path(newname, path)
    return unicode(newname), unicode(newpath)
----------

Recompile it:
python2 -O pyrenamer_filefuncs.py

Revision history for this message
André Ventura (afv) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.