WordPress wp.media returns wrong image size in object
-
When using the wp.media function and returning an object back with the selected image. The width and heights on the custom image sizes and the ‘large’ wp defined image size show as wrong. The URL and the actual image are correct but not in the object. I’ve bolded the three sizes that are incorrect below
here is the JS
https://pastebin.com/FdzNB5W2It is on a basic admin page and all it has is a select image, the media modal opens select an image and returns the object.
It is a fresh 5.5 install
Object
chaplin_fullscreen: {height: 580, width: 580, url: “https://192.168.0.42/sites/foxly/testpress/wp-conte…ploads/2020/07/thcf75eoad151-scaled-1980×1980.jpg”, orientation: “landscape”}
full: {url: “https://192.168.0.42/sites/foxly/testpress/wp-content/uploads/2020/07/thcf75eoad151-scaled.jpg”, height: 2560, width: 2560, orientation: “landscape”}
imagetest: {height: 305, width: 580, url: “https://192.168.0.42/sites/foxly/testpress/wp-conte…uploads/2020/07/thcf75eoad151-scaled-1200×630.jpg”, orientation: “landscape”}
large: {height: 580, width: 580, url: “https://192.168.0.42/sites/foxly/testpress/wp-conte…ploads/2020/07/thcf75eoad151-scaled-1024×1024.jpg”, orientation: “landscape”}
medium: {height: 300, width: 300, url: “https://192.168.0.42/sites/foxly/testpress/wp-conte…/uploads/2020/07/thcf75eoad151-scaled-300×300.jpg”, orientation: “landscape”}
thumbnail: {height: 150, width: 150, url: “https://192.168.0.42/sites/foxly/testpress/wp-conte…/uploads/2020/07/thcf75eoad151-scaled-150×150.jpg”, orientation: “landscape”}
__proto__: Object
- The topic ‘WordPress wp.media returns wrong image size in object’ is closed to new replies.