Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When True Crop generates a new filename, it currently does not take into account the possibility that a previous crop has been deleted.
So for example, if picture.jpg, picture_2.jpg, and picture_4.jpg exist (with picture_3.jpg having been deleted) it will currently create a new crop as picture_3.jpg. It would be better to create picture_5.jpg in that case; this is more logical for the list of files in the administrative interface, and also has the advantage that it avoids reusing the URL of a deleted file (which could be cached somewhere, etc) when possible to avoid doing so.
Comments
Comment #2
David_Rothstein CreditAttribution: David_Rothstein at Tag1 Consulting commentedHere is a patch.
Comment #3
David_Rothstein CreditAttribution: David_Rothstein at Tag1 Consulting commentedCommitted the fix.
Comment #5
David_Rothstein CreditAttribution: David_Rothstein at Tag1 Consulting commentedI committed a followup fix to change the query to use db_like() so it will work correctly even if there are wildcard characters in the filename. Attaching the final combined patch that was added to the module via this issue.
Comment #7
David_Rothstein CreditAttribution: David_Rothstein at Tag1 Consulting commentedAnd another followup commit to make this all work when the original image (e.g. "picture.jpg") is the one that was deleted.