Changes between Initial Version and Version 1 of Ticket #40370, comment 17
- Timestamp:
- 08/24/2019 04:53:05 AM (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #40370, comment 17
initial v1 1 1 There was a discussion in the [https://wordpress.slack.com/archives/C02SX62S6/p1566609255394300?thread_ts=1566481102.355100&cid=C02SX62S6 #core-media channel on Slack] about image sub-size names and file names. 2 2 3 There are several related tickets and couple of ideas about how to fix them. Generally the solution seems to be to add a short hash to image sub-size file names (like in 40370.diff) but in order to fix the file name clashing with `-WxH`, it would need to add that hash in all cases, not just for cropped images. Then the hash can be generated from the sub-size settings array. For example:3 There are several related tickets and couple of ideas about how to fix them. Generally the solution seems to be to add a short hash to image sub-size file names (like in 40370.diff) but in order to fix the file name clashing with original files named like `my-image-file-name-800x600.jpg`, it would need to add that hash in all cases, not just for cropped images. Then the hash can be generated from the sub-size settings array. For example: 4 4 {{{ 5 5 $size_settings = array ( … … 31 31 }}} 32 32 33 Yet another idea is to append `-1`, `-2`, etc. to the file name (before the `- WxH` part) when testing for unique file name. That will be a bit more complex in case of sizes with the same dimensions and different crop values. It will have to keep previously tested and approved file names in cache and test/increment against them too.33 Yet another idea is to append `-1`, `-2`, etc. to the file name (before the `-800x600` part) when testing for unique file name. That will be a bit more complex in case of sizes with the same dimensions and different crop values. It will have to keep previously tested and approved file names in cache and test/increment against them too. 34 34 35 35 Related: #42437.