Make WordPress Core

Opened 5 years ago

Last modified 4 months ago

#44867 accepted enhancement

image editor: save modified image as a new copy

Reported by: drzraf's profile drzraf Owned by: joedolson's profile joedolson
Milestone: 6.3 Priority: normal
Severity: normal Version: 5.2
Component: Media Keywords: has-patch
Focuses: administration Cc:

Description

WordPress allows multiple image sizes to be defined by a theme : they will affect how hard-crop/soft-crop is being used.

Sometimes no autocropping is desirable because editors want to care themselves about it.
For example blog posts having two images ratios (thumbnail for listing, 3:1 for wide-width header).
Giving the possibility to derive one image from the other is very interesting : it avoid uploading two different images but still gives editor ability to do fine-tuned cropping.

For this to work the image editor must be able to save a modified image as a COPY of the original image.

Would an implementation be accepted?

https://wordpress.org/ideas/topic/image-editing-option-to-save-a-copy

Attachments (8)

0001-44867-image-editor-save-modified-image-as-a-new-copy.patch (3.6 KB) - added by drzraf 5 years ago.
patch v1
0002-44867-handle-new-image-size.patch (1.2 KB) - added by drzraf 4 years ago.
improvement: if cropping as a copy, correctly change corresponding metadata
fullpatch-v2-44867-image-editor-save-modified-image-as-a-new-copy.patch (3.3 KB) - added by drzraf 4 years ago.
patch v2
fullpatch-v3-44867-image-editor-save-modified-image-as-a-new-copy.patch (3.3 KB) - added by drzraf 4 years ago.
updated for WP5
fullpatch-v4-44867-image-editor-save-modified-image-as-a-new-copy.patch (2.8 KB) - added by drzraf 3 years ago.
v4 compatible with 5.3.2
fullpatch-v5-44867-image-editor-save-modified-image-as-a-new-copy.patch (2.8 KB) - added by drzraf 3 years ago.
fullpatch-v6-44867-image-editor-save-modified-image-as-a-new-copy.patch (2.9 KB) - added by drzraf 11 months ago.
reroll WP 6.0
fullpatch-v7-44867-image-editor-save-modified-image-as-a-new-copy.patch (2.9 KB) - added by drzraf 11 months ago.
reroll WP 6.0

Download all attachments as: .zip

Change History (26)

#1 @drzraf
5 years ago

  • Keywords has-patch added

Closing image editor triggers a imageEdit.close() does this._view.back().
But there is no way that I know to refresh media editor (from this._view) afterwards, but that would be needed to show the newly created attachment.

Other elements open to discussion:

  • The image image suffix (-e<timestamp>) may not fit (it'd mess with images backups).
  • The title substitution (appending the hardcoded string -mediacopy)
  • The fact that upload directory is kept to the value of the original file (instead of putting <current-year>/<current-month>)
Last edited 5 years ago by drzraf (previous) (diff)

#2 @mukesh27
5 years ago

  • Focuses administration added

#3 @drzraf
5 years ago

image-edit.php: @nacin @adamsilverstein ?

#4 follow-up: @adamsilverstein
5 years ago

For this to work the image editor must be able to save a modified image as a COPY of the original image.

@drzraf can you explain what you are trying to do?

i don't think i understand why this is required - why you need a copy of the image (can you use the original itself)? can you do what you need with custom crop/sizes?

#5 in reply to: ↑ 4 @drzraf
5 years ago

Replying to adamsilverstein:

For this to work the image editor must be able to save a modified image as a COPY of the original image.

@drzraf can you explain what you are trying to do?

Editor wants to add a rectangular 3:1 image to a blog post. He uploads one adequate image as an image field.

Then he wants to also provide a square image as a (optional) thumbnail (be it for search-listing, OpenGraph image, ... ...):

  • Solution 1: Use the same header image as the thumbnail.
  • => Thumbnail is auto-cropped (center, North-East, ...) but this is probably useless because the (square) region of interest is not there and must be selected by hand.
  • Solution 2: Upload the image a second time and crop it by hand.
  • => ok, but could be better
  • Solution 3: Crop it locally using a desktop application, then upload
  • => ok, but could be better

If user crops the original image (rather than a copy), he looses the possibility to use the original rectangular one as a 3:1 header image.

I think it makes sense to allow editors to create multiple derivatives from one image without having the upload the original file multiple times.

#6 @adamsilverstein
5 years ago

Thanks for explaining. Typically you would have predefined crops/aspect rations in your theme for different image placements, however I can see a use case for the ability to duplicate an existing media item, giving you a copy you can then do what you want with. Would a "duplicate image" function in the medial library fit your needs?

This feature might make more sense as something a plugin can provide.

#7 @drzraf
5 years ago

Yes, a duplicate media would be fine.
That way editors could quickly define various flavors of one image, cropping the way they want in order to get extract the best portion according to their human feeling.

I'd personally prefer to see a "duplicate" button in the media editor because that's the place/moment people would look for it so that would improve efficiency:
Just click "duplicate" then immediately start editing/cropping the copy.

NB: I think a kind of medias relationship should be maintained somewhere (post meta?)

#8 @drzraf
4 years ago

Dear WP team,
could you advise how to move forward on this?

  • As patch shows, there is no apparent way to implement this as a plugin.
  • There is a missing bit about editor since, I don't know how to refresh the media browser listing (because a new file is added) when image editor is closed.
Last edited 4 years ago by drzraf (previous) (diff)

@drzraf
4 years ago

improvement: if cropping as a copy, correctly change corresponding metadata

#9 @pento
4 years ago

  • Version trunk deleted

#10 @drzraf
4 years ago

  • Version set to trunk

#11 @drzraf
4 years ago

Patch needs reroll for 4.3, but before doing that or engaging myself in indefinite rerolls, I'd really like to get more comments from upstream about this feature, implementation and inclusion.

#12 @joedolson
11 months ago

  • Milestone changed from Awaiting Review to 6.1

I think incorporating this into the image editor experience would help to increase the usability of the editor, since the user would more easily understand the consequences of their action: choosing between 'duplicate and create new' vs 'modify current' makes it clear what the work you're doing will impact.

I'll keep this open; but I'm going to work on integrating these changes with #50523.

Thanks for persisting on this, @drzraf!

This ticket was mentioned in Slack in #core-media by joedolson. View the logs.


11 months ago

#14 @joedolson
10 months ago

  • Owner set to joedolson
  • Status changed from new to accepted

This ticket was mentioned in Slack in #core-media by joedolson. View the logs.


9 months ago

This ticket was mentioned in Slack in #core-media by joedolson. View the logs.


9 months ago

#17 @joedolson
8 months ago

  • Milestone changed from 6.1 to Future Release

#18 @joedolson
4 months ago

  • Milestone changed from Future Release to 6.3
Note: See TracTickets for help on using tickets.