pushtype / push_type

PushType is a modern, open source content management system for Ruby on Rails.
http://www.pushtype.org
Other
290 stars 32 forks source link

SVG media assets being processed as bitmap images #20

Closed aaronrussell closed 7 years ago

aaronrussell commented 7 years ago

From @mat2maa

Just a note on the SVG issue above, they upload fine, but links sources of the form src="/media/2016/11/17/4ws32cd79b_Filename.svg?style=push_type_thumb" are broken. Removing the ?style=push_type_thumb shows it.

jonleighton commented 7 years ago

@aaronrussell it's a shame that this makes it impossible to preview an SVG in the admin at all. Perhaps the original SVG could just be used? (i.e. no thumbnail at all)

Perhaps as well, the "File name" field when you view an asset could be a link which allows you to see the original asset.

aaronrussell commented 7 years ago

@jonleighton yeah SVGs are a little bit awkward here. In this scenario I only want a small thumbnail, so if we used the original SVG it would most of the time be stretched/squahshed. Also wouldn't want to use the original file if it was a large file. I agree it's not ideal though.

As for the linking to a preview somehow - yes agreed. Irrespective of whether it's a SVG this would be useful. I'm working on a redesign of the admin UI so will definitely try to address that one 👍

jonleighton commented 7 years ago

I tried replacing the img src attribute via developer tools and it seemed to squash the image to size without distortion. I can see that this could be problematic with large files, though. Maybe it would be possible to look at the SVG file size to decide whether to display it (although I'm not sure how much file size is related to rendering complexity...)