[wp-trac] [WordPress Trac] #37750: Cropping custom logo should preserve attachment properties

WordPress Trac noreply at wordpress.org
Wed Mar 23 15:53:20 UTC 2022


#37750: Cropping custom logo should preserve attachment properties
-------------------------------------------------+-------------------------
 Reporter:  flixos90                             |       Owner:  joedolson
     Type:  defect (bug)                         |      Status:  accepted
 Priority:  normal                               |   Milestone:  6.0
Component:  Media                                |     Version:  4.5
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests has-        |     Focuses:
  screenshots                                    |  accessibility
-------------------------------------------------+-------------------------

Comment (by hellofromTonya):

 Replying to [comment:29 antonvlasenko]:
 > Just FYI: this PR has some breaking changes.
 > Currently, WordPress always overwrites `Title` and `Description`
 properties (with `name` and `url` of the image file respectively) when we
 crop an image.
 > If this PR gets merged, these properties will only be populated
 (overwritten) if `Title` and `Description` properties of the original
 image are empty.
 > I'm not sure if that's desired behavior, but I can't think of a better
 implementation.

 [https://github.com/WordPress/wordpress-develop/pull/2441 PR 2441] does
 pre-populate a new cropped image's properties from the original image's
 properties - including the `Title` and `Description`. The `Title` though
 doesn't compare if the user edited it though - proposing that change in
 the code review.

 The PR seems to align to [#comment:2 the intent proposed by @flixos90]
 >fill in the values the user entered for the original image (as defaults)

 But yes, both the `Title` and `Description` properties existing behavior /
 values are changed by the PR.

 What about the original intent? Looking at the existing data and [33280] /
 #29211 that added this functionality:

 * there's no discussion about the properties.
 * and thus, both `Title` and `Description` seem to be generic placeholders
 to create the new cropped image.

 To me, as a user, I'd expect to retain the original image's properties and
 be given the ability to modify them when cropping. If the [#comment:1
 properties sidebar is also exposed as @Clorith proposed], then the user is
 given that ability.

 Hey @flixos90 @Clorith what do you think today (as this one is an oldie)?
 Any concerns about changing the existing behavior for the `Title` and
 `Description`? Or does it still make sense today to pre-populate with the
 original image's properties and show the properties sidebar?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/37750#comment:30>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list