• Hello, I have an issue with renaming where some of the pictures already exist in a directory (although not part of wordpress Media library). Such weird situation is a result of optimizer plugin, which keeps original file and renames optimized images by adding prefix. Media file renamer skips renaming pictures where file already exist. I would prefer if the plugin asked for confirmation for overwriting or simpler, overwrite without asking. I am also capable to add this option to plugin myself. Would you prefer to do it yourself, or would you like if I added this option as contributor?

    Best, L.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Jordy Meow

    (@tigroumeow)

    Hi,

    Overwriting can’t be an option: it might be a (big) mistake to do so most of the time. Adding a modal asking for overwriting would also be quite some work, for a feature that was also never asked (and even more difficult in the bulk process, that is usually run overnight and shouldn’t have any popups).

    You can add this option for yourself, but I am not sure it would be good to have this in the native plugin, or maybe I missed the point? 🙂

    I worked with a lot of optimizer plugin but I am not sure why it would be a problem to keep the original file somewhere and to work with different names files, Renamer has always worked with EWWW for example, that does that.

    Thread Starter Lovro Hrust

    (@lovor)

    Hi,
    thanks for the answer. Perhaps I am the only one with this need?
    The problem with optimizing plugin is, while it keeps original file intact, it renames the optimized image files by adding prefix before the filename. Apparently, this is not good for the SEO, and my client wants the image file names without prefixes.

    Perhaps overwriting is not an good idea, but maybe renaming original file before the renaming process starts is an better one? If rename process fails without a message to the user why, like it does now, is also not an good idea 🙂

    I just discovered by looking at your code that output should be placed at log file media-file-renamer.log in plugins directory. However, there is no such file created in my case. I also discovered there should be a message in the log file if renaming fails due to already existing filename: “The new file already exists ($new_filepath). It is not a case issue. Renaming cancelled.”

    I also discovered there is a filter “mfrh_force_rename” that should forcefully rename even if the file exists. This could solve my problem.

    I am still wondering why logging does not work.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Overwrite existing image’ is closed to new replies.