Image Type SVG

16 posts by 5 authors in: Forums > CMS Builder
Last Post: February 5, 2021   (RSS)

done:)

Cheers,

Tim (toledoh.com.au)

By Jenna - January 27, 2021

Hi Tim,

I just wanted to check in on this post: was Hans able to help you get to an acceptable solution for this, or are you still looking for guidance?

Please let us know.

Jenna Cooke - PHP Programmer
interactivetools.com

By Toledoh - January 27, 2021

No Jenna, it was never resolved.  thanks for following up.

Cheers,

Tim (toledoh.com.au)

By Steve99 - February 4, 2021

Came up with a working patch based on Daryl's post.

Latest cmsb version in same file (upload_functions.php) and function (showUploadPreview) Daryl referenced.

Before
// output preview html

Add

  // display image preview for svg image file type
  if (preg_match("/\.(svg)$/i", $uploadRecord['urlPath'])) {
    $bestSrc    = $uploadRecord['urlPath'];
    $bestWidth  = "50";
    $bestHeight = "50";
  }

Seems those three strings aren't being set for svg's since their width and height values are saved as 0 in the uploads table.

By Toledoh - February 5, 2021

Thanks Steve!  I've travelling currently - but will test it out later next week!

Cheers,

Tim (toledoh.com.au)