Make WordPress Core

Opened 3 hours ago

Last modified 8 minutes ago

#63757 new defect (bug)

The crop function doesn't work with ai generated PNG

Reported by: linopolo's profile linopolo Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.8.2
Component: General Keywords: has-screenshots reporter-feedback
Focuses: Cc:

Description

"I'm using WordPress 6.8.2. The bug occurs both on my live website and locally with XAMPP. I generated a PNG image with ChatGPT, uploaded it to the media library, and used the crop tool. I applied the crop and saved the result. However, when I insert the image into a page, it appears uncropped.
I Attach the image so you can test it

Attachments (8)

immagine test.png (2.7 MB) - added by linopolo 3 hours ago.
image
exif.txt (4.2 KB) - added by linopolo 3 hours ago.
exif file by exif tool 13.30_64
immagine testconvertita.jpg (354.1 KB) - added by linopolo 72 minutes ago.
test image in jpg
cleaned_image.png (2.6 MB) - added by Presskopp 62 minutes ago.
test2-600x600.jpg (174.3 KB) - added by linopolo 17 minutes ago.
Jpg 600 x600
test2-600x600.png (1.5 MB) - added by linopolo 17 minutes ago.
png 600 x 600
test3-600x400.jpg (264.4 KB) - added by linopolo 7 minutes ago.
Jpg 600 x 400
test3-600x400.png (2.2 MB) - added by linopolo 7 minutes ago.
png 600 x 400

Change History (21)

@linopolo
3 hours ago

image

@linopolo
3 hours ago

exif file by exif tool 13.30_64

#1 @SirLouen
3 hours ago

  • Keywords reporter-feedback added

Hello @linopolo
Can you try to add the image, and then go to the right sidebar > Block > Resolution and Select Full Size or Thumbnail?

I'm not 100% sure, but it feels that the cropped Large size is not being generated correctly.

#2 @linopolo
2 hours ago

Ok it works.
To run a more accurate test, I converted the generated image to JPG, then uploaded it to the library, cropped and inserted it into the page. The problem persists. On the other hand, a regular PNG taken from Google retains the cropping.

Last edited 2 hours ago by linopolo (previous) (diff)

#3 @Presskopp
89 minutes ago

Can it be that the C2PA data is blocking the conversion?

Check your image on

https://contentcredentials.org/verify

and you will see it has content credentials

#4 follow-up: @linopolo
87 minutes ago

yes the image has C2PA data I updated also the complete exif of the image

#5 in reply to: ↑ 4 @SirLouen
84 minutes ago

Replying to linopolo:

yes the image has C2PA data I updated also the complete exif of the image

Can you also upload the JPG you mentioned before?

@linopolo
72 minutes ago

test image in jpg

#6 @linopolo
72 minutes ago

Ok here's the the jpg

#7 @Presskopp
63 minutes ago

I stripped the JUMBF data entirely from the original png:

Last edited 49 minutes ago by Presskopp (previous) (diff)

#8 @linopolo
56 minutes ago

Thank you for the support. So, at this point, what will happen? Will there be any changes to WordPress? Or should I just stick to the first suggestion you gave me?

#9 follow-up: @Presskopp
50 minutes ago

Oh wait, my mistake. I did push the 'update' button instead of 'Save Edits'. I'm sorry.

#10 in reply to: ↑ 9 @SirLouen
45 minutes ago

Replying to Presskopp:

Oh wait, my mistake. I did push the 'update' button instead of 'Save Edits'. I'm sorry.

I bet it's not a metadata problem. @linopolo try with another of those "AI-generated images", with different dimensions. Instead of 1024×1536, try with a square image 600x600, for example. I have a feeling that there coudl be an edge case bug.

#11 @Presskopp
41 minutes ago

The issue seems to be the generation of the 'large' size only, as you mentioned before.

#12 @linopolo
18 minutes ago

Ok, I generated by chatGPT a 600 x 600 image png. I converted it in jpg.
I Uploaded all two on the library, cropped both then inserted in a page and it works.
Now I upload the two images for yout test

@linopolo
17 minutes ago

Jpg 600 x600

@linopolo
17 minutes ago

png 600 x 600

#13 @linopolo
8 minutes ago

to be complete I generated a 600 x 400 png image. did the same step and it works.
now I upload the photo

@linopolo
7 minutes ago

Jpg 600 x 400

@linopolo
7 minutes ago

png 600 x 400

Note: See TracTickets for help on using tickets.