Make crop editor usable #22
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "crop-editor"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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):
@ -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'] . '/';
Edge case:
suffix
can be null, as the group is optional in the regex. Handle this.@ -148,2 +155,4 @@
$custom_key = 'custom_' . $data->thumb_width . 'x' . $data->thumb_height;
if (isset($meta[$custom_key]))
{
// TODO: delete from disk
Is this still needed?
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.
@ -217,0 +209,4 @@
option.dataset.crop_region = data.value;
option.textContent = option.textContent.replace(/top|bottom|centre|slice/, "exact");
// TODO: update meta
Is this needed for this PR?
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.