Skip to content
This repository was archived by the owner on Aug 12, 2023. It is now read-only.

Need to round image sizes when naming image #10

Closed
defaria opened this issue Sep 24, 2017 · 5 comments
Closed

Need to round image sizes when naming image #10

defaria opened this issue Sep 24, 2017 · 5 comments

Comments

@defaria
Copy link

defaria commented Sep 24, 2017

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.

@junaidbhura
Copy link
Owner

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!

@junaidbhura
Copy link
Owner

@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!

@defaria
Copy link
Author

defaria commented Sep 26, 2017

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.

@junaidbhura
Copy link
Owner

Haha, no worries 😊

I'll build this in anyway, so the plugin handles cases like this correctly!

@junaidbhura
Copy link
Owner

I've added support to handle this better! 1939533

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants