Make crop editor usable #22

Merged
Aaron merged 27 commits from crop-editor into master 2020-12-30 20:06:17 +01:00
Member

This merges upstream changes to the crop editor, making it actually usable.

Previously, the only way to edit a crop boundary was to specify it manually in the crop editor toolbar. With these changes, however, you can use mouse input to recreate and reposition the boundary.

In addition, a bug in computing the initial crop boundary for portrait photos has been fixed.

Before (master):

After (this PR):

This merges upstream changes to the crop editor, making it actually usable. Previously, the only way to edit a crop boundary was to specify it manually in the crop editor toolbar. With these changes, however, you can use mouse input to recreate and reposition the boundary. In addition, a bug in computing the initial crop boundary for portrait photos has been fixed. Before (master): ![](https://gitea.hashru.nl/attachments/9c671863-1bcb-46e2-9764-1bba48b19e12) After (this PR): ![](https://gitea.hashru.nl/attachments/b951f882-d445-47a7-ace5-7eebfdc3d898)
Aaron reviewed 2020-12-30 15:23:07 +01:00
@ -118,1 +118,4 @@
// Does the thumbnail exist on disk? If not, use an url to generate it.
if (!$filename || !file_exists(THUMBSDIR . '/' . $subdir . '/' . $filename))
$thumb_url = BASEURL . '/thumbnail/' . $image->getId() . '/' . $thumb['width'] . 'x' . $thumb['height'] . $thumb['suffix'] . '/';
Author
Member

Edge case: suffix can be null, as the group is optional in the regex. Handle this.

Edge case: `suffix` can be null, as the group is optional in the regex. Handle this.
Aaron marked this conversation as resolved
Roflin reviewed 2020-12-30 19:53:59 +01:00
@ -148,2 +155,4 @@
$custom_key = 'custom_' . $data->thumb_width . 'x' . $data->thumb_height;
if (isset($meta[$custom_key]))
{
// TODO: delete from disk
Owner

Is this still needed?

Is this still needed?
Author
Member

It ought to be done, but I'd like to refactor thumbnail file management in general so this kind of thing is not left to the individual controllers.

It ought to be done, but I'd like to refactor thumbnail file management in general so this kind of thing is not left to the individual controllers.
Roflin reviewed 2020-12-30 19:56:01 +01:00
@ -217,0 +209,4 @@
option.dataset.crop_region = data.value;
option.textContent = option.textContent.replace(/top|bottom|centre|slice/, "exact");
// TODO: update meta
Owner

Is this needed for this PR?

Is this needed for this PR?
Author
Member

Thanks. No, this just still hasn't been implemented; it wasn't before, either. I'd like to refactor the form a little before I take this on.

Thanks. No, this just still hasn't been implemented; it wasn't before, either. I'd like to refactor the form a little before I take this on.
Aaron merged commit d069ddca18 into master 2020-12-30 20:06:17 +01:00
Aaron deleted branch crop-editor 2020-12-30 20:06:23 +01:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Public/pics#22
No description provided.