Refactor photo uploading #23

Open
opened 2022-01-27 18:22:18 +01:00 by thisfro · 0 comments
Owner

Both Service\OfferPhotoHelper and Service\PhotoResizer should work together directly insted of individual calls from the controller.

Instead of uploading the full-size image first, saving it and then converting it, the save step should be skipped. If implementation allows it, client side compression would be even better.

Conversion to webp could be implemented as well for increased performance. It is as easy as

$photo = $this->imagine->open($filename);
$photo = $photo->resize(new Box($width, $height))->save($filename.split(".")[0] . "webp");

using Imagine\Gd\Imagine

Both `Service\OfferPhotoHelper` and `Service\PhotoResizer` should work together directly insted of individual calls from the controller. Instead of uploading the full-size image first, saving it and then converting it, the save step should be skipped. If implementation allows it, client side compression would be even better. Conversion to `webp` could be implemented as well for increased performance. It is as easy as ```php $photo = $this->imagine->open($filename); $photo = $photo->resize(new Box($width, $height))->save($filename.split(".")[0] . "webp"); ``` using `Imagine\Gd\Imagine`
thisfro added the
Idea
label 2022-01-27 18:22:18 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference: thisfro/pflaenz.li-Symfony#23
No description provided.