You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
the content-type of svg image file is crashed after gzip compressing sync to aws #323
I wasn't trying to prevent compression. It should be fine if they are
compressed as long as the mime type gets set properly on S3. Without this
the mime type was getting set to application/gzip for me. Maybe we are
actually after different end results.
I wasn't trying to prevent compression. It should be fine if they are
compressed as long as the mime type gets set properly on S3. Without this
the mime type was getting set to application/gzip for me. Maybe we are
actually after different end results.
I am not familiar enough in this area to have a strong opinion, but I am generally in favor of things that work "out of the box" without any additional manual configuration additions.
I'm seeing the same, my svg files get to cloudfront (AWS CDN) as application/gzip which means they aren't displayed. Work around is png for now, but would prefer svg.
Yes but it complained it was already defined and I'm on rails 4 at the
moment. Will investigate when I get a chance. Thanks!
On 5 Jul 2016 12:38, "Emil Sågfors" notifications@github.com wrote:
I guess we should let users know they need to put something like Mime::Type.register "image/svg+xml", :svg for custom file types
And also let them know there are some types already registered by rails (and that list might change in the future)
Activity
danielfarrell commentedon Apr 21, 2016
For those who find this later, this seems to be better handled by registering the svg mime type in an initializer:
coneybeare commentedon Apr 22, 2016
@danielfarrell This didn't work for me when placed in
mime_types.rb. Are you successfully preventingasset_syncfrom compressing svg's upon upload?danielfarrell commentedon Apr 22, 2016
I wasn't trying to prevent compression. It should be fine if they are
compressed as long as the mime type gets set properly on S3. Without this
the mime type was getting set to application/gzip for me. Maybe we are
actually after different end results.
On Friday, April 22, 2016, Matt Coneybeare notifications@github.com wrote:
coneybeare commentedon Apr 22, 2016
Nope, I was misidentifying the problem. Was set as txt/plain before and your fix made it work, once my cloudfront copy was invalidated (face-palm)
PikachuEXE commentedon Apr 25, 2016
@coneybeare
Do you think #322 is still required?
hothero commentedon Apr 25, 2016
So we just register Mime::Type "image/svg+xml" and will not get nil from Mime::Type.lookup_by_extension(ext), right?
If true, maybe readme need to append more advanced usage. But I think #322 still have some use for the future, Mime::Type looks have no all of types.
PikachuEXE commentedon Apr 25, 2016
So what is a preferred API for searching mime type?
::MIME::Types.type_fororMime::Type.lookup_by_extension?coneybeare commentedon Apr 25, 2016
I am not familiar enough in this area to have a strong opinion, but I am generally in favor of things that work "out of the box" without any additional manual configuration additions.
PikachuEXE commentedon Apr 26, 2016
@coneybeare
I am fine with that
But I am not familiarized with that mime types gem
danielfarrell commentedon Apr 26, 2016
Seems to me the best way to handle this is a PR against that gem to add the missing mime types. Anyone have a list of ones that are commonly issues?
PikachuEXE commentedon Apr 27, 2016
@danielfarrell
I am more interested in why the result give by
:MIME::Types.type_forMime::Type.lookup_by_extensionare different
I don't know where are these 2 methods documented
So it could be our usage is incorrect
lloydwatkin commentedon Jul 5, 2016
I'm seeing the same, my svg files get to cloudfront (AWS CDN) as
application/gzipwhich means they aren't displayed. Work around is png for now, but would prefer svg.lime commentedon Jul 5, 2016
@lloydwatkin Have you tried the suggestion above to register the right mime type for svg?
Rails recently (5.0) got the above added to the default mime types: rails/rails@7e35cb2
lloydwatkin commentedon Jul 5, 2016
Yes but it complained it was already defined and I'm on rails 4 at the
moment. Will investigate when I get a chance. Thanks!
On 5 Jul 2016 12:38, "Emil Sågfors" notifications@github.com wrote:
@lloydwatkin https://github.com/lloydwatkin Have you tried the suggestion
above to register the right mime type for svg?
config/initializers/mime_types.rbMime::Type.register "image/svg+xml", :svg
Rails recently got the above added to the default mime types: rails/rails@
7e35cb2
rails/rails@7e35cb2
It's available in 5.0.0.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#323 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAQlBu3ebLp5DMCrnfSZeWRIuXs2WQvEks5qSkJRgaJpZM4Hik-t
.
PikachuEXE commentedon Jul 6, 2016
I guess we should let users know they need to put something like
Mime::Type.register "image/svg+xml", :svgfor custom file typesAnd also let them know there are some types already registered by rails (and that list might change in the future)