Opened 4 months ago
Closed 4 months ago
#48518 closed defect (bug) (fixed)
Inconsistent behavior when a registered image size is larger than the big image threshold
| Reported by: |  | Owned by: |  | 
|---|---|---|---|
| Milestone: | 5.3 | Priority: | normal | 
| Severity: | normal | Version: | 5.3 | 
| Component: | Upload | Keywords: | has-patch fixed-major commit dev-feedback | 
| Focuses: | Cc: | 
Description
When a registered image sub-size is larger than the big image threshold, it is still used to create the sub-sizes in wp_create_image_subsizes() but not in wp_update_image_subsizes().
Happens because wp_get_missing_image_subsizes() only looks at the existing image meta and doesn't take into account the original image dimensions.
Attachments (1)
Change History (10)
    
      
    #1
  
    
        
          
             @
 @
            
4 months ago
        
    
  
  
  - Keywords has-patch 2nd-opinion added
- Milestone changed from Awaiting Review to 5.3
    
      
         
        
This ticket was mentioned in Slack in #core-media by azaozz. View the logs.
      
      
4 months ago
    
    
  
              
    
      
         
        
This ticket was mentioned in Slack in #core-media by mike. View the logs.
      
      
4 months ago
    
    
  
              
    
      
    #4
  
    
        
          
             @
 @
            
4 months ago
        
    
  
  
    
This looks to be working for me, @azaozz! I have a 3000x3000 soft crop image size and 4000x4000 hard crop image size registered and it works correctly!
    
      
    #5
  
    
        
          
             @
 @
            
4 months ago
        
    
  
  
    
Thanks for testing!
Lets add it to trunk for some more/easier testing and merge tomorrow if all looks good.
    
      
    #6
  
    
        
          
             @
 @
            
4 months ago
        
    
  
  
  - Owner set to azaozz
- Resolution set to fixed
- Status changed from new to closed
In 46677:



 
			 
                
Moving to 5.3 as it is an inconsistency with the new "big image" handling.
In 48518.diff: when an image was scaled because it is larger than the big image threshold, use the originally uploaded image's dimensions in
wp_get_missing_image_subsizes(). This fixes an edge case/inconsistent behaviour when a registered image sub-size is also larger than the big image threshold.