- /* Download the watermark image to a local file */
- $tmpDir = $gallery->getConfig('data.gallery.tmp');
- $watermark = $platform->tempnam($tmpDir, 'wmk_img_');
- $watermark.= "." . $watermarkExt;
- list ($successfullyCopied, $response, $headers) =
- GalleryCoreApi::fetchWebFile($watermarkImage, $watermark, $extraHeaders);
- if (!$successfullyCopied) {
- return array(GalleryCoreApi::error(ERROR_STORAGE_FAILURE,__FILE__,__LINE__,
- "Unable to copy watermark image from url: $watermarkImage - $response"),null,null);
+ /* Download the watermark image to a local file */
+ $tmpDir = $gallery->getConfig('data.gallery.tmp');
+ $watermark = $platform->tempnam($tmpDir, 'wmk_img_');
+ $watermark.= "." . $watermarkExt;
+ list ($successfullyCopied, $response, $headers) =
+ GalleryCoreApi::fetchWebFile($watermarkImage, $watermark, $extraHeaders);
+ if (!$successfullyCopied) {
+ return array(GalleryCoreApi::error(ERROR_STORAGE_FAILURE,__FILE__,__LINE__,
+ "Unable to copy watermark image from url: $watermarkImage - $response"),null,null);
+ }
+ } else {
+ $tmpDir = $gallery->getConfig('data.gallery.tmp');
+ $watermark = $platform->tempnam($tmpDir, 'wmk_img_');
+ $watermark.= "." . $watermarkExt;
+ if(!$platform->copy($watermarkImage, $watermark)) {
+ return array(GalleryCoreApi::error(ERROR_STORAGE_FAILURE,__FILE__,__LINE__,
+ "Unable to copy watermark image from path: $watermarkImage"),null,null);
+ }