-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fully supports progressive JPGS and Interlaced images for 3.x #394
base: 3.x
Are you sure you want to change the base?
Conversation
TODO:
|
@ADmad would you mind to take a look and tell me what you think? I'm not sure if introducing this new encoding strategy would be the best for this package. feedbacks are welcome :) |
Sorry I haven't had the time to look into this but could you please address the failing tests in the meantime. |
@ADmad I addressed all the issues that Github Actions was issuing. Before setting this ready for review, could you point me the best place where I could add the tests for the progressive/interlaced images I am introducing? |
@ADmad I added some comments to help the review process. Ideally, it would be good to add tests for the new option added to the image API. But I don't have idea what would be the best place to put it. |
src/Manipulators/Encode.php
Outdated
break; | ||
case 'gif': | ||
case 'png': | ||
$encoderOptions['interlaced'] = $shouldInterlace; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quality option isn't used for png/gif?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, there is no such option anymore.
- https://github.com/Intervention/image/blob/develop/src/Encoders/GifEncoder.php#L11
- https://github.com/Intervention/image/blob/develop/src/Encoders/PngEncoder.php#L11
Options are pretty limited in this new version.
@ADmad I applied the suggested changes and also add a new doc entry for the new option. I'm just not sure how to preview documentation locally, but I guess it is following the same convention used before. Also, do you have idea on how we could test this new feature? I just updated |
The intent of this PR is to introduce support to generate progressive JPEGs or interlaced images.
Couple days ago, the author of Intervention provided support to accomplish that https://github.com/Intervention/image/releases/tag/3.6.0
With that, I did some adjustments on Glide API to get the desired support.
Highlights:
Encode
manipulator moved from the$manipulators
list, because it needs to be the last manipulator to run when generating the images.Encode
manipulator now returns aEncodedImage
. This change avoids to double encode image when generating it.Encode
also makes more use of Interventionenums
to encode the image properly.