Comments (5)
Additional info from local debugging: this is the unserialized meta data from one of the images causing the error:
This is the raw unserialized meta data from the database:
Array
(
[width] => 100
[height] => 100
[file] => Website-Icons-68.svg
[sizes] => Array
(
[thumbnail] => Array
(
[width] => 150
[height] => 150
[crop] => 1
[file] => Website-Icons-68.svg
[mime-type] => image/svg+xml
)
[medium] => Array
(
[width] => 300
[height] => 300
[crop] =>
[file] => Website-Icons-68.svg
[mime-type] => image/svg+xml
)
[medium_large] => Array
(
[width] => 768
[height] => 0
[crop] =>
[file] => Website-Icons-68.svg
[mime-type] => image/svg+xml
)
[large] => Array
(
[width] => 1024
[height] => 1024
[crop] =>
[file] => Website-Icons-68.svg
[mime-type] => image/svg+xml
)
[1536x1536] => Array
(
[width] =>
[height] =>
[crop] =>
[file] => Website-Icons-68.svg
[mime-type] => image/svg+xml
)
[2048x2048] => Array
(
[width] =>
[height] =>
[crop] =>
[file] => Website-Icons-68.svg
[mime-type] => image/svg+xml
)
[woocommerce_thumbnail] => Array
(
[width] =>
[height] =>
[crop] =>
[file] => Website-Icons-68.svg
[mime-type] => image/svg+xml
[uncropped] =>
)
[woocommerce_single] => Array
(
[width] =>
[height] =>
[crop] =>
[file] => Website-Icons-68.svg
[mime-type] => image/svg+xml
)
[woocommerce_gallery_thumbnail] => Array
(
[width] =>
[height] =>
[crop] =>
[file] => Website-Icons-68.svg
[mime-type] => image/svg+xml
)
[shop_catalog] => Array
(
[width] =>
[height] =>
[crop] =>
[file] => Website-Icons-68.svg
[mime-type] => image/svg+xml
)
[shop_single] => Array
(
[width] =>
[height] =>
[crop] =>
[file] => Website-Icons-68.svg
[mime-type] => image/svg+xml
)
[shop_thumbnail] => Array
(
[width] =>
[height] =>
[crop] =>
[file] => Website-Icons-68.svg
[mime-type] => image/svg+xml
)
[dgwt-wcas-product-suggestion] => Array
(
[width] =>
[height] =>
[crop] =>
[file] => Website-Icons-68.svg
[mime-type] => image/svg+xml
)
)
)
This is the var_dump of the meta the plugin is using at the point of exception - you can see the width and height is missing:
array(4) {
["width"]=>
int(0)
["height"]=>
int(0)
["file"]=>
string(20) "Website-Icons-68.svg"
["sizes"]=>
array(10) {
["woocommerce_thumbnail"]=>
array(6) {
["width"]=>
bool(false)
["height"]=>
bool(false)
["crop"]=>
bool(false)
["file"]=>
string(20) "Website-Icons-68.svg"
["mime-type"]=>
string(13) "image/svg+xml"
["uncropped"]=>
bool(false)
}
["woocommerce_gallery_thumbnail"]=>
array(5) {
["width"]=>
bool(false)
["height"]=>
bool(false)
["crop"]=>
bool(false)
["file"]=>
string(20) "Website-Icons-68.svg"
["mime-type"]=>
string(13) "image/svg+xml"
}
["woocommerce_single"]=>
array(5) {
["width"]=>
bool(false)
["height"]=>
bool(false)
["crop"]=>
bool(false)
["file"]=>
string(20) "Website-Icons-68.svg"
["mime-type"]=>
string(13) "image/svg+xml"
}
["dgwt-wcas-product-suggestion"]=>
array(5) {
["width"]=>
bool(false)
["height"]=>
bool(false)
["crop"]=>
bool(false)
["file"]=>
string(20) "Website-Icons-68.svg"
["mime-type"]=>
string(13) "image/svg+xml"
}
["thumbnail"]=>
array(5) {
["width"]=>
string(3) "150"
["height"]=>
string(3) "150"
["crop"]=>
string(1) "1"
["file"]=>
string(20) "Website-Icons-68.svg"
["mime-type"]=>
string(13) "image/svg+xml"
}
["medium"]=>
array(5) {
["width"]=>
string(3) "300"
["height"]=>
string(3) "300"
["crop"]=>
bool(false)
["file"]=>
string(20) "Website-Icons-68.svg"
["mime-type"]=>
string(13) "image/svg+xml"
}
["medium_large"]=>
array(5) {
["width"]=>
string(3) "768"
["height"]=>
string(1) "0"
["crop"]=>
bool(false)
["file"]=>
string(20) "Website-Icons-68.svg"
["mime-type"]=>
string(13) "image/svg+xml"
}
["large"]=>
array(5) {
["width"]=>
string(4) "1024"
["height"]=>
string(4) "1024"
["crop"]=>
bool(false)
["file"]=>
string(20) "Website-Icons-68.svg"
["mime-type"]=>
string(13) "image/svg+xml"
}
["1536x1536"]=>
array(5) {
["width"]=>
int(1536)
["height"]=>
int(1536)
["crop"]=>
int(0)
["file"]=>
string(20) "Website-Icons-68.svg"
["mime-type"]=>
string(13) "image/svg+xml"
}
["2048x2048"]=>
array(5) {
["width"]=>
int(2048)
["height"]=>
int(2048)
["crop"]=>
int(0)
["file"]=>
string(20) "Website-Icons-68.svg"
["mime-type"]=>
string(13) "image/svg+xml"
}
}
}
from cloudinary_wordpress.
This was directly related to SVG support in Wordpress. The SVG plug we were using (SVG Support - most popular!) was not setting the widths for SVGs where WP's attachment functions were not.
We installed a different plugin (Safe SVG) and the problem is solved.
I think there is still a bug here where if this does happen, it would be useful to set a default or to throw an error more helpful to customers to find a solution rather than spending time debugging core WP attachment handling and Cloudinary's plugin code.
from cloudinary_wordpress.
Hi @nomadic-energy-dev, Is it only a specific SVG that was throwing the error? Would you have the SVG in question so I can have a look? Could you also share if SVG Support
under the Cloudinary Image settings was enabled?. Thanks!
from cloudinary_wordpress.
Thanks - enabling svg support resolved this. Could we improve error handling to catch and report a more useful error in this case?
from cloudinary_wordpress.
@nomadic-energy-dev awesome news! Glad it fixed the issue. I'll share this with our development team in case there is anything they can do.
from cloudinary_wordpress.
Related Issues (20)
- Can't add an image from Cloudinary to the Image Block HOT 3
- Local URL for media instead of Cloudinary URL in rest api HOT 18
- PHP 8.1 support HOT 4
- Proper image urls don't come through WPGraphQL HOT 7
- Cloudinary URL no returned for background url in css HOT 1
- Cloudinary URLs for WPGraphQL Yoast SEO Addon HOT 4
- Calling wp_calculate_image_srcset in a multisite environment returns the wrong srcset HOT 5
- Bug Report: Cloudinary Version 3.0.2 - cloudinary.openMediaLibrary is not a function HOT 5
- Cloudinary v3.0.4 incompatible with Elementor plugin when saving Chinese text HOT 2
- PHPCompatibiltyWP missing from PHPCS config file HOT 4
- Getting a crash (HTTP ERROR 500) when trying to edit page with WP Bakery and Cloudinary plugin activated HOT 2
- Using cloudinary_wordpress with polylang plugin causes error in the site Editor HOT 3
- Cloudinary urls replaced everywhere in the admin but not when accessing acf fields directly HOT 2
- Old URL used when uploading media from the WordPress APP via the block editor HOT 3
- This is failing and returning notice error HOT 4
- clean_url method no longer exists in Delivery class HOT 4
- Unable to install plugin - class Cloudinary\Utils does not have a method "install" HOT 4
- Responsive mode breakpoints are not the same for landscape and portrait images HOT 5
- Cloudinary Process killed by long process killer HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cloudinary_wordpress.