Skip to content

[WIP] Do not alter pictures unless filters applied#186

Closed
rawbertp wants to merge 1 commit intoandreknieriem:masterfrom
rawbertp:rp-no-filter
Closed

[WIP] Do not alter pictures unless filters applied#186
rawbertp wants to merge 1 commit intoandreknieriem:masterfrom
rawbertp:rp-no-filter

Conversation

@rawbertp
Copy link
Copy Markdown
Contributor

@rawbertp rawbertp commented Nov 6, 2019

This is a follow-up to #172

@sualko

I think we can also skip the jpeg conversion, if no filters/borders and so on are applied. That would also enhance the performance.

#172 (comment)

Change:

When no filters selected the original image will be kept/used.

@sualko
Copy link
Copy Markdown
Collaborator

sualko commented Nov 21, 2019

I think this pr needs an update because the commit can't be found.

@rawbertp
Copy link
Copy Markdown
Contributor Author

Not sure what you mean? I can see 80a3daa even when not logged in...

@sualko
Copy link
Copy Markdown
Collaborator

sualko commented Nov 21, 2019

I probably followed a link in an email and while you force-pushed the referenced commit was not there. Sorry for the confusion.

Copy link
Copy Markdown
Collaborator

@sualko sualko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this pr is good in general, but the code quality could be enhanced.

Comment thread api/applyEffects.php

// image scale, create thumbnail
$thumbResource = resizeImage($imageResource, 500, 500);
$thumbResource = resizeImage(createImageResource($imageResource, $filename_tmp), 500, 500);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are always creating a thumbnail and therefore we always have to create a image resource.

Comment thread api/applyEffects.php

imagejpeg($imageResource, $filename_photo, $config['jpeg_quality_image']);
imagedestroy($imageResource);
if (!empty($imageResource)) imagedestroy($imageResource);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point $imageResource is always not empty.

Comment thread api/applyEffects.php
// apply filter
if ($image_filter) {
applyFilter($image_filter, $imageResource);
applyFilter($image_filter, createImageResource($imageResource, $filename_tmp));
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me this makes the code less readable.

@andi34 andi34 force-pushed the master branch 2 times, most recently from 847f587 to cf39905 Compare January 11, 2020 16:07
@andi34 andi34 mentioned this pull request Feb 24, 2020
@andi34
Copy link
Copy Markdown
Collaborator

andi34 commented Aug 6, 2020

#226 was merged.

When no filters selected the original image will be kept/used: e3678a7

@andi34 andi34 closed this Aug 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants