summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-09-16 20:04:22 -0700
committerBharat Mediratta <bharat@menalto.com>2010-09-16 20:04:22 -0700
commit64dfccc4eddf204a80ce533bad69ac8c0c83c1bd (patch)
treea9e803f23c2d93d579b11d4f0dd1e9aabed01e0c
parentde2f9baeee0a05968ef0c3809c90e335180cffd0 (diff)
Preserve the image extension on the temp file that we create for
rotating images. Some versions of GD won't work if we don't do this. Fixes ticket #1375.
-rw-r--r--modules/gallery/controllers/quick.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/gallery/controllers/quick.php b/modules/gallery/controllers/quick.php
index c34209da..3db4f5df 100644
--- a/modules/gallery/controllers/quick.php
+++ b/modules/gallery/controllers/quick.php
@@ -36,7 +36,8 @@ class Quick_Controller extends Controller {
}
if ($degrees) {
- $tmpfile = tempnam(TMPPATH, "rotate");
+ $tmpfile = tempnam(TMPPATH, "rotate") . "." .
+ pathinfo($item->file_path(), PATHINFO_EXTENSION);
gallery_graphics::rotate($item->file_path(), $tmpfile, array("degrees" => $degrees));
$item->set_data_file($tmpfile);
$item->save();