[wp-trac] [WordPress Trac] #64943: WP generates duplicate pictures after Upload

WordPress Trac noreply at wordpress.org
Tue Mar 24 20:59:02 UTC 2026


#64943: WP generates duplicate pictures after Upload
--------------------------+------------------------------
 Reporter:  fotodrachen   |       Owner:  (none)
     Type:  defect (bug)  |      Status:  assigned
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Media         |     Version:  6.9.4
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by opurockey):

 Default subsizes of images for 1024 and 768 like 1024*1024 and 798*0;


 WordPress uses aspect ratio preservation (proportional scaling) for soft-
 crop sizes. The original image is 1153 × 1536 (portrait orientation —
 height > width).
 The core ratio from the original:

 `width/height = 1153/1536 ≈ 0.7507`
 `height/width = 1536/1153 ≈ 1.3321`



 **1024×1024 → produces 769×1024**
 This is a soft crop (constrain within a bounding box). WordPress asks:
 which dimension hits the limit first?

 **Try fitting to width 1024:**
 `height = 1024 × (1536/1153) = 1024 × 1.3321 = 1363.9  ❌ exceeds 1024`

 **Try fitting to height 1024:**
 `width = 1024 × (1153/1536) = 1024 × 0.7507 = 768.72 → 769  ✅ fits`


 Since it's a portrait image, height is the constraining dimension. So
 height is locked to 1024, and width is derived from the ratio → 769×1024.


 **768×0 → produces 768×1023**
 The 0 means no height constraint — only width is fixed. Height always
 scales proportionally.

 `height = 768 × (1536/1153) = 768 × 1.3321 = 1023.05 → 1023`
 Width is locked to 768, height is derived from the ratio → 768×1023.

 **Why 769 vs 768? (the subtle difference)**
 `1024×1024 Height locked to 1024. So 1024 × (1153/1536) = 769`
 `768×0 Width locked to 768. So 768 × (1536/1153) = 1023`

 The multipliers are different (1024 vs 768), so the resulting constrained
 dimension differs by 1 pixel after rounding. They're both correct — they
 just start from a different anchor dimension.

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


More information about the wp-trac mailing list