preserve the image type
authorMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 23 Oct 2010 14:37:38 +0000 (10:37 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 25 Oct 2010 13:29:22 +0000 (09:29 -0400)
horde/services/images/view.php

index 8f61532..2bdb781 100644 (file)
@@ -74,9 +74,11 @@ if (!empty($conf['image']['convert'])) {
     $context['convert'] = $conf['image']['convert'];
     $context['identify'] = $conf['image']['identify'];
 }
-$image = Horde_Image::factory($driver, array('context' => $context));
+$type = Horde_Mime_Magic::analyzeData($file_data);
+$image = Horde_Image::factory($driver,
+                              array('context' => $context));
 $image->loadString($file_data);
-
+$image->setType($type);
 /* Check if no editing action required and send the image to browser. */
 if (empty($action)) {
     $image->display();