SVG images blocked by gmail proxy

It seems that the new gmail proxy for images does not work with SVG (gives a 404 error if you open the proxy URL in a new tab.)

I could not find documentation on supported / blocked file types. Does svg work in gmail for someone else?

The only workaround I can come up with is creating png svg on the server using PhantomJS - any other options?

Background:

This is for a webapp that sends daily consolidated email messages showing a schedule covering the last 24 hours (so svg is different every day since it saves the user in an email as a result of clicking on the application).

I know that SVG images will not work in some email clients, but it will work at 95%, the rest can still click on the web folder.

It worked fine in gmail until the proxy server changed earlier this month (which just logged into Google Apps accounts at the end of the month.)

+20
proxy svg phantomjs gmail
Dec 28 '13 at 14:21
source share
1 answer

I heard from Google support, and they confirmed that there are currently no plans to support SVG images in a proxy server. They said that they make up only 1 out of 100,000 email images.

Besides PhantomJs, for a simpler svg is the php-plugin ImageMagick.

Here is a sample code to get started:

header("Content-Type: image/png"); header("Content-Disposition: inline;"); if (empty($svg)) { readfile("invisibleImage.png", true); } else { //TODO: You'll probably want to set headers to cache the returned image $filepath = "/path/to/where/images/are/cached/"; if (!file_exists("$filepath$svgName.png")) { if (!is_dir($filepath)) { mkdir($filepath, 0700, 1); } file_put_contents("$filepath$svgName.svg", $svg); $cmd = "rsvg-convert $filepath$msk.svg > $filepath$svgName.png"; exec($cmd); unlink("$filepath$svgName.svg"); } readfile("$filepath$svgName.png"); } 

You need to install at least some of the following elements:

 apt-get install librsvg2-bin libpng3 imagemagick libpng12-dev \ 
+20
Jan 11 '14 at 16:27
source share
— -



All Articles