darkstardigital / phpThumbsUp

ModX package for creating dynamic image thumbnails
10 stars 7 forks source link

FR: Avoid image manipulating at SVG #31

Open rwam opened 10 years ago

rwam commented 10 years ago

In my app a user can upload SVG-Files to use it as images into a gallery. But a svg as thumbnail should not manipulate, it makes no sense. So I insert the following lines into the snippet:

// input
$image = !empty($input) ? trim($input) : '';
$options = !empty($options) ? trim($options) : '';

if (preg_match('/\.svg$/', $input)) {
    return $input;
}
...

What do you think?

Ciao Ralf