rick Posted October 16, 2020 Share Posted October 16, 2020 (edited) I have an image field with SVG as one of the allowed file types. However, when I try to upload an SVG image in page edit, I get the following error: Error Call to undefined function ProcessWire\simplexml_load_string() File: .../www/cre8aplace/wire/core/Pageimage.php:533 523: * @return array of width and height 524: * 525: */ 526: protected function getImageInfoSVG($filename = '') { 527: $width = 0; 528: $height = 0; 529: if(!$filename) $filename = $this->filename; 530: $xml = @file_get_contents($filename); 531: 532: if($xml) { 533: $a = @simplexml_load_string($xml)->attributes(); 534: if((int) $a->width > 0) $width = (int) $a->width; 535: if((int) $a->height > 0) $height = (int) $a->height; 536: } 537: Other image types load fine. I haven't seen a post relating to this issue, so I assume it's pilot error again. ? Is there some special field setting I have missed or is this an actual bug? Is it a continuation of the git issue regarding dimension attributes? <svg id="e532202f-8294-4472-8a94-ef01c23bf434" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1111.01" height="589.53" viewBox="0 0 1111.01 589.53"> There is no attributes section in the file. The dimensions are included in the header as shown. Edited October 16, 2020 by rick id10t Link to comment Share on other sites More sharing options...
adrian Posted October 16, 2020 Share Posted October 16, 2020 @rick - have a read of this: Link to comment Share on other sites More sharing options...
adrian Posted October 16, 2020 Share Posted October 16, 2020 @rick - Actually, sorry I didn't read properly - the issue is that you don't have the "php-xml" PHP module installed. 1 Link to comment Share on other sites More sharing options...
rick Posted October 16, 2020 Author Share Posted October 16, 2020 Dagnabit! ^ My best Walter Brennan impression. 1 Link to comment Share on other sites More sharing options...
adrian Posted October 16, 2020 Share Posted October 16, 2020 6 minutes ago, rick said: Dagnabit! ^ My best Walter Brennan impression. Wow, you're going back in time there ? I remember my parents talking about him, and I am sure I saw a few of his movies in my youth (they liked a good western), but don't honestly remember that expression. 1 Link to comment Share on other sites More sharing options...
rick Posted October 16, 2020 Author Share Posted October 16, 2020 I'm an old fart. Thanks for reminding me. ? 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now