Although imagemagick was supported by my provider (Strato), and path seemed OK, I was still getting this error. Strato could not help me.
What I did was the following:
1 Installed http://www.zubrag.com/scripts/thumbnail-generator.php
in the root of my site ( 2 files). This script enables resizing and saving resulting image. This script assumes PHP GD is installed.
2) Adapted thumb.php to use Omeka image paths:
$images_folder = '/var/tmp/';
// Folder to save thumbnails, full path from the root folder, MUST end with slash.
$thumbs_folder = '/home/strato/www/yo/www.yoursite.nl/htdocs/OMEKA/archive/';
(use absolute paths)
3 Did some adaptions in
...Libraries/Omeka/File/Derivative/Image.php
a)
public static function createAll($originalFilePath, $fileMimeType)
self::checkOmekaCanMakeDerivativeImages();
return self::isDerivable($originalFilePath, $fileMimeType)
? self::createMy
DerivativeImages($originalFilePath)
: false;
b)
/**
* Generate all the derivative images for this file.
*
* Currently, derivative images include:
* - 'fullsize'
* - 'thumbnail'
* - 'square_thumbnail'
* New sizes could be added if a plugin were to
* hook into the 'after_file_upload' hook, so this method does not need to
* be extensible.
*
* @param string $path File to create derivatives of.
* @return string Derived image name.
*/
public static function createMyDerivativeImages($path)
{
$newFileName = self::_getFileName($path);
$url="http://www.yoursite.nl/thumb.php?src=" . $newFileName ."&dest=square_thumbnails/". $newFileName ."&x=100&y=100";
file_get_contents($url);
$url="http://www.yoursite.nl/thumb.php?src=" . $newFileName ."&dest=thumbnails/". $newFileName ."&x=100&y=100";
file_get_contents($url);
$command= "cp ". $path . " /home/strato/www/yo/www.yoursite.nl/htdocs/OMEKA/archive/fullsize/".$newFileName;
$imageName = "";
exec($command, $result_array, $result_value);
if ($result_value == 0) {
return $imageName;
} else {
throw new Omeka_File_Derivative_Exception('Unix CP failed somehow');
}
}