myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [2621] trunk/app/controllers/previews_controller.


From: noreply
Subject: [myexperiment-hackers] [2621] trunk/app/controllers/previews_controller.rb: fixed SVG mime type
Date: Wed, 29 Jun 2011 09:19:37 -0400 (EDT)

Revision
2621
Author
dgc
Date
2011-06-29 09:19:37 -0400 (Wed, 29 Jun 2011)

Log Message

fixed SVG mime type

Modified Paths

Diff

Modified: trunk/app/controllers/previews_controller.rb (2620 => 2621)


--- trunk/app/controllers/previews_controller.rb	2011-06-29 09:22:34 UTC (rev 2620)
+++ trunk/app/controllers/previews_controller.rb	2011-06-29 13:19:37 UTC (rev 2621)
@@ -23,10 +23,10 @@
 
     case type
 
-      when 'full';   name = 'full';   source = 'image'; size = nil
-      when 'medium'; name = 'medium'; source = 'image'; size = 500
-      when 'thumb';  name = 'thumb';  source = 'image'; size = 100 
-      when 'svg';    name = 'svg';    source = 'svg';   size = nil
+      when 'full';   name = 'full';   source = 'image'; size = nil; mime_type = 'image/jpeg'
+      when 'medium'; name = 'medium'; source = 'image'; size = 500; mime_type = 'image/jpeg'
+      when 'thumb';  name = 'thumb';  source = 'image'; size = 100; mime_type = 'image/jpeg'
+      when 'svg';    name = 'svg';    source = 'svg';   size = nil; mime_type = 'image/svg+xml'
       else
         render(:inline => 'Bad preview type', :status => "400 Bad Request")
         return
@@ -34,7 +34,7 @@
 
     file_name = @context.preview.file_name(type)
 
-    send_cached_data(file_name, :type => 'image/jpeg', :disposition => 'inline') {
+    send_cached_data(file_name, :type => mime_type, :disposition => 'inline') {
 
       case source
         when 'image'; content_blob = @context.preview.image_blob

reply via email to

[Prev in Thread] Current Thread [Next in Thread]