commit 333f5d8efdf196a1d6a398b9060ad78f242ffc1c
parent ed99f5541d28cbba4ecc46264bc260f0cade468e
Author: Felicitus <felicitus@felicitus.org>
Date: Sun, 9 Dec 2012 12:00:20 +0100
Create the image flag after the attachment has been updated, not before
Diffstat:
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/src/backend/PartKeepr/Part/PartAttachment.php b/src/backend/PartKeepr/Part/PartAttachment.php
@@ -159,8 +159,8 @@ class PartAttachment extends UploadedFile implements Serializable, Deserializabl
* @param string $path The path to the original file
*/
public function replace ($path) {
- $this->isImage = $this->canImagickParseImage();
parent::replace($path);
+ $this->isImage = $this->canImagickParseImage();
}
/**
@@ -168,7 +168,20 @@ class PartAttachment extends UploadedFile implements Serializable, Deserializabl
* @param string $url
*/
public function replaceFromURL ($url) {
- $this->isImage = $this->canImagickParseImage();
parent::replaceFromURL($url);
+ $this->isImage = $this->canImagickParseImage();
}
+
+ /**
+ * Replaces the file with a given temporary file.
+ *
+ * Additionally checks if the attachment is an image and flags the attachment as such.
+ *
+ * @param string $id The temporary id (prefixed with TMP:)
+ */
+ public function replaceFromTemporaryFile ($id) {
+ parent::replaceFromTemporaryFile($id);
+
+ $this->isImage = $this->canImagickParseImage();
+ }
}
\ No newline at end of file