-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Adjust image editing naming schema #22580
Description
Follow-up from #21024 (comment)
I'm not that fond of the naming schema. crop-21-41-35-20-rotate-180-crop-21-41-35-20-IMG_20190825_104317-scaled-300x225.jpg doesn't sound particularly good (compared to IMG_20190825_104317-scaled.jpg) and will easily exceed the max file name length allowed on some filesystems.
If we had a reference to the original, unedited, image stored and we did the batched edits from #22579, we could better calculate a name for images. The order of operations is still important, so rotate-90-scale-300x255 is different from scale-300x225-rotate-90.
I like that the current implementation includes the unique edits that were made to the image so an edit doesn't have to be made if there's already a matching filename. It also has the benefit of making it easy, when browsing your media, to know which edits have been made if you had a couple different crops and were comparing between the two. A more reliable way to test for sameness could be to store an checksum of the image and compare against that instead.