-
Notifications
You must be signed in to change notification settings - Fork 26
Need to round image sizes when naming image #10
Comments
Hey @defaria thanks for pointing this out. Since all the image sizes are added in explicitly, I'm not sure how the file names get a decimal point? Can you give me a scenario where this would happen? Thanks for your thoughts on image optimization :) . I'm glad you thought it was a good idea too! |
@defaria Not sure where your previous comment went 😕 But in reply, I think what you've pointed out is an issue, and the plugin should be able to handle this. I'll build this in and update the plugin soon. Cheers! |
Sorry about that. I posted while at work and it went under the wrong git account. So I removed it really quickly, but I guess you still saw it. Anyway, the issue was on my end. I was doing some math calculations to keep images at the right ratio. I had this calculations being done on a separate function and completely forgot about it. |
Haha, no worries 😊 I'll build this in anyway, so the plugin handles cases like this correctly! |
I've added support to handle this better! 1939533 |
The name of the image is based on the returned size. However, sometimes the returned size is not an integer. So you ended up with file names such as my_image500x340.333333.jpg. I think rounding up the numbers before naming the image would help.
On another note. I think it's best to have removed image optimization, at least for now. A lot of servers out there won't allow extra php packages to be loaded. I think a third-party request or cdn is best for image optimization.
The text was updated successfully, but these errors were encountered: