summaryrefslogtreecommitdiff
path: root/modules/gallery/models
diff options
context:
space:
mode:
authorNathan Kinkade <nkinkade@nkinka.de>2009-12-22 23:34:50 +0000
committerNathan Kinkade <nkinkade@nkinka.de>2009-12-22 23:34:50 +0000
commit5855c4333ce6929c63d5639c7623152d80447d47 (patch)
treee2a22c1b7c6d95539fd63984622124deb934b875 /modules/gallery/models
parent1baaeeefe81ef1a96153a050e9307d99768dd0df (diff)
parent86e0bc863a1c6739a9cd153931c099307e4c1000 (diff)
Merge branch 'master' of git://github.com/gallery/gallery3
Diffstat (limited to 'modules/gallery/models')
-rw-r--r--modules/gallery/models/item.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php
index d27e331b..96415b3d 100644
--- a/modules/gallery/models/item.php
+++ b/modules/gallery/models/item.php
@@ -157,7 +157,16 @@ class Item_Model extends ORM_MPTT {
@rename(VARPATH . "albums/$old_relative_path", VARPATH . "albums/$new_relative_path");
@rename(VARPATH . "resizes/$old_relative_path", VARPATH . "resizes/$new_relative_path");
- @rename(VARPATH . "thumbs/$old_relative_path", VARPATH . "thumbs/$new_relative_path");
+ if ($this->is_movie()) {
+ // Movie thumbnails have a .jpg extension
+ $old_relative_thumb_path = preg_replace("/...$/", "jpg", $old_relative_path);
+ $new_relative_thumb_path = preg_replace("/...$/", "jpg", $new_relative_path);
+ @rename(VARPATH . "thumbs/$old_relative_thumb_path",
+ VARPATH . "thumbs/$new_relative_thumb_path");
+ } else {
+ @rename(VARPATH . "thumbs/$old_relative_path", VARPATH . "thumbs/$new_relative_path");
+ }
+
$this->name = $new_name;
if ($this->is_album()) {