Skip to content

Commit

Permalink
Preserve the image extension on the temp file that we create for
Browse files Browse the repository at this point in the history
rotating images.  Some versions of GD won't work if we don't do this.
Fixes ticket #1375.
  • Loading branch information
bharat committed Sep 17, 2010
1 parent de2f9ba commit 64dfccc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/gallery/controllers/quick.php
Expand Up @@ -36,7 +36,8 @@ public function rotate($id, $dir) {
}

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();
Expand Down

0 comments on commit 64dfccc

Please sign in to comment.