summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/mime.pdf.php2
-rwxr-xr-xplugins/processor.imagick.php5
2 files changed, 4 insertions, 3 deletions
diff --git a/plugins/mime.pdf.php b/plugins/mime.pdf.php
index 5b428f9..d2cbe77 100644
--- a/plugins/mime.pdf.php
+++ b/plugins/mime.pdf.php
@@ -221,7 +221,7 @@ function mime_pdf_thumbnail( $pFileHash ) {
if( is_file( $thumb_file ) && filesize( $thumb_file ) > 0 ) {
$genHash = [
'attachment_id' => $pFileHash['attachment_id'],
- 'dest_branch' => $pFileHash['upload']['dest_branch'] ?? $dest_branch,
+ 'dest_branch' => $pFileHash['upload']['dest_branch'] ?? rtrim( str_replace( STORAGE_PKG_PATH, '', $dest_branch ), '/' ).'/',
'source_file' => $thumb_file,
'type' => 'image/jpeg',
];
diff --git a/plugins/processor.imagick.php b/plugins/processor.imagick.php
index e85c6ff..c02b640 100755
--- a/plugins/processor.imagick.php
+++ b/plugins/processor.imagick.php
@@ -120,7 +120,7 @@ function liberty_imagick_resize_image( &$pFileHash ) {
}
// destroy object
- $im->destroy();
+ $im->clear();
$ret = $destFile;
} catch( ImagickException $e ) {
@@ -145,9 +145,10 @@ function liberty_imagick_rotate_image( &$pFileHash ) {
} elseif( empty( $pFileHash['degrees'] ) || !is_numeric( $pFileHash['degrees'] )) {
$pFileHash['error'] = KernelTools::tra( 'Invalid rotation amount' );
} else {
- $im->rotateImage( new ImagickPixel(), $pFileHash['degrees'] );
+ $im->rotateImage( new ImagickPixel('none'), $pFileHash['degrees'] );
$im->writeImage( $pFileHash['source_file'] );
}
+ $im->clear();
} catch( ImagickException $e ) {
\Bitweaver\bit_error_log( $e->getMessage().' '.$pFileHash['source_file'] );
$pFileHash['error'] = $e->getMessage();