• I new to WP and using rename to clean up an existing small site. When I rename a file that has a starting filename that has the suffix “-scaled”, where WP shows an “original filename” in the side panel, after the rename the original filename is changed but clicking on the link generates a 404 error.

    Possibly I’m tripping this up in my process, but it is definitely a user trap if I am. Being new to WP, I simply changed the filename to what I wanted and deleted the “-scaled” suffix. WP appended the “-scaled” suffix to the saved filename, as I’ve read since I saw that that it does when the image is too wide. I wonder if I left the “-scaled” suffix on the filename if the issue might be avoided, but I haven’t tried uploaded a new file.

    I’m running LocalWP, though that should not matter. The site has the following plugins:
    Classic Editor
    Duplicate Page
    Enable Media Replace (deactivated)
    Envato Market
    Goodlayers Core
    Goodlayers Portfolio Post Type
    Location Weather
    Ninja Forms
    Phoenix Media Rename
    Site Kit by Google
    Slider Revolution

    Thanks!

Viewing 3 replies - 16 through 18 (of 18 total)
  • Plugin Author crossi72

    (@crossi72)

    Version 3.10.1 is out, it seems that everything is ok, but I will make more testing as soon as possible.

    Let me know if you find some other issues.
    C.

    Thread Starter carnelianwoods

    (@carnelianwoods)

    Still broken. I’ll document that more in another post.

    Since WP does not offer a rename function, you get to define what that behavior means, but the “Principal of Least Surprise” should apply. That means, behaviors should be intuitive and expected, and respect WP’s behaviors.

    The filename suffix “-scaled” is essentially a “reserved spelling” to WP, and has special meaning. Since PMR allows file renaming, it should try to prevent the user from corrupting WP with their action. The “sanitize filename” option is an example of an excellent feature that does just that. WP itself prevents collisions with “-scaled” on upload by appending “-1” to the filename so that no filename can be created by the user with a “-scaled” suffix, e.g., uploading filename-scaled.gif becomes filename-scaled-1.gif and creates the scaled version filename-scaled-1-scaled.gif.

    The plugin code appears now to remove “-scaled” from the filename *before* it is displayed to the user in the Filename field. In addition to allowing a bug (described in another post), WP displays the filename in the medial library page and in the edit media page, right column, with “-scaled”.

    For UI consistency, either the filename entry field needs to be called “Original image name” (which for other reasons can be confusing), or the filename displayed should not have “-scaled” removed. The “-scaled” needs to be removed internally *after* the user clicks Update and process from there. It’s possible that internally it needs to keep both versions for appropriate use internal cases to make the code come out right and not end up with the “Original image” having “-scaled” or ending up with “-scaled-scaled” in the filename. I don’t know where the codes functions are handed back and forth from WP to the plugin, so maybe this isn’t possible.

    Thread Starter carnelianwoods

    (@carnelianwoods)

    Getting closer. As mentioned above, “-scaled” is a reserved filename suffix for WP. It’s hard to know what unexpected issues might come up if filenames can be changed to “-scaled” that are not actually scaled and thus don’t have the directory structure with an original image (without “-scaled”) and a “-scaled” version of the image, and thumbnails without the “-scaled” suffix.

    The user can add the “-scaled” suffix to the filename if the remainder of the filename is unique. This results in:

    Original image: contains “-scaled” suffix
    Displayed filename in right panel: contains “-scaled-scaled” suffix
    Filename: contains “-scaled” suffix

    This may also be confusing to the user (or more so a subsequent user), despite it being their action, since a “-scaled” filename suffix has a specific meaning in WP.

Viewing 3 replies - 16 through 18 (of 18 total)
  • The topic ‘Original of scaled file lost after rename’ is closed to new replies.