[WIP] Do not alter pictures unless filters applied#186
Closed
rawbertp wants to merge 1 commit intoandreknieriem:masterfrom
Closed
[WIP] Do not alter pictures unless filters applied#186rawbertp wants to merge 1 commit intoandreknieriem:masterfrom
rawbertp wants to merge 1 commit intoandreknieriem:masterfrom
Conversation
a85af6d to
80a3daa
Compare
Collaborator
|
I think this pr needs an update because the commit can't be found. |
Contributor
Author
|
Not sure what you mean? I can see 80a3daa even when not logged in... |
Collaborator
|
I probably followed a link in an email and while you force-pushed the referenced commit was not there. Sorry for the confusion. |
sualko
requested changes
Nov 21, 2019
Collaborator
sualko
left a comment
There was a problem hiding this comment.
I think this pr is good in general, but the code quality could be enhanced.
|
|
||
| // image scale, create thumbnail | ||
| $thumbResource = resizeImage($imageResource, 500, 500); | ||
| $thumbResource = resizeImage(createImageResource($imageResource, $filename_tmp), 500, 500); |
Collaborator
There was a problem hiding this comment.
We are always creating a thumbnail and therefore we always have to create a image resource.
|
|
||
| imagejpeg($imageResource, $filename_photo, $config['jpeg_quality_image']); | ||
| imagedestroy($imageResource); | ||
| if (!empty($imageResource)) imagedestroy($imageResource); |
Collaborator
There was a problem hiding this comment.
At this point $imageResource is always not empty.
| // apply filter | ||
| if ($image_filter) { | ||
| applyFilter($image_filter, $imageResource); | ||
| applyFilter($image_filter, createImageResource($imageResource, $filename_tmp)); |
Collaborator
There was a problem hiding this comment.
For me this makes the code less readable.
847f587 to
cf39905
Compare
Merged
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a follow-up to #172
@sualko
#172 (comment)
Change:
When no filters selected the original image will be kept/used.