commit 3e30c9491708633bb5c9e422a0dfa720bd0f8435
parent a10e9eb5650fece0afb62a0ed513025f9ea39eb1
Author: dankert <devnull@localhost>
Date: Sun, 23 Dec 2007 18:31:27 +0100
Attribut "tmpfile" erg?nzt.
Diffstat:
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/objectClasses/File.class.php b/objectClasses/File.class.php
@@ -43,7 +43,9 @@ class File extends Object
var $publish = null;
var $mime_type = '';
var $width = null;
- var $height = null;
+ var $height = null;
+
+ var $tmpfile;
@@ -258,7 +260,7 @@ class File extends Object
$this->write(); // Datei schreiben
// Bildinformationen ermitteln
- $size = getimagesize( $this->tmpfile() );
+ $size = getimagesize( $this->tmpfile() );
// Breite und Hoehe des aktuellen Bildes
$oldWidth = $size[0];
@@ -350,7 +352,6 @@ class File extends Object
{
// Verwende TrueColor (GD2)
$newImage = imageCreateTrueColor( $newWidth,$newHeight );
-
ImageCopyResampled($newImage,$oldImage,0,0,0,0,$newWidth,
$newHeight,$oldWidth,$oldHeight);
}
@@ -624,9 +625,12 @@ EOF
*/
function tmpfile()
{
- $db = db_connection();
- $filename = $this->getTempDir().'/openrat_db'.$db->id.'_'.$this->objectid.'.tmp';
- return $filename;
+ if ( $this->tmpfile == '' )
+ {
+ $db = db_connection();
+ $this->tmpfile = $this->getTempDir().'/openrat_db'.$db->id.'_'.$this->objectid.'.tmp';
+ }
+ return $this->tmpfile;
}
@@ -634,7 +638,7 @@ EOF
{
@unlink( $this->tmpfile() );
- $this->setTimestamp();
+ parent::setTimestamp();
}
}