ISSUE SUMMARY:
In JomSocialBackend -> Photos -> Photosettings There is an option for ImageMagick Path. I seem to have some ImageMagick Binaries installed but not compiled with PHP. For example when I am in the shell I can run /usr/bin/convert
to execute commands. Is this the path it is looking for in the settings? Specifically the 'convert'? ImageMagick seems to have a few executables/binaries so not sure what it means by path exactly.
STEPS TO REPLICATE:
1 JomSocialBackend -> Photos -> Photosettings
2
3
4
5
RESULT
EXPECTED RESULT
BROWSER
Hi,
We have bug on imagick path, which is the manual setting is not working, the system cant read the configuration of imagick path.
The solution is you need install imagick library on php itself, and it will be execute as imagick php class.
thank you
Hi John,
To fix this issue please you open this file components/com_community/controllers/photos.php, find this code :
if($isGifAnimation && !class_exists('Imagick')){
$magickPath = $config->get('magickPath');
if($isGifAnimation && !class_exists('Imagick') && empty($magickPath)){
Thanks, I changed out this line of text. I go to the frontend and upload an animated gif (I select animated gif) and see the image with a little play icon. However when I click the play icon, it turns into a broken picture. In my case I get a console error "07f11313dde62b4030168cc7_animated.gif:1 GET www-staging.rit.edu/emcs/theloop/images/...0168cc7_animated.gif 404 (Not Found)" so it is not finding the image with _animated. I can try to do a bit of debugging in the meantime.
It appears as the change you suggested may not be enough to fix this from my investigation. There should be a second file with a '_animated.gif' at the end but this is not being created. I noticed that when you save a photo it calls a function in the file 'components/com_community/helpers/image.php'. It seems that it will attempt to use the php exec command and call image magick, but that section of code on line 224 does not ever generate the _animated.gif files from the debugging I did
} else if (!empty($magickPath) && !class_exists('Imagick')) {
// Execute the command to resize. In windows, the commands are executed differently.
if (JString::strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$file = rtrim($config->get('magickPath'), '/') . '/convert.exe';
$command = '"' . rtrim($config->get('magickPath'), '/') . '/convert.exe"';
} else {
$file = rtrim($config->get('magickPath'), '/') . '/convert';
$command = '"' . rtrim($config->get('magickPath'), '/') . '/convert"';
}
if (JFile::exists($file) && function_exists('exec')) {
$execute = $command . ' -resize ' . $destWidth . 'x' . $destHeight . ' ' . $srcPath . ' ' . $destPath;
exec($execute);
// Test if the files are created, otherwise we know the exec failed.
if (JFile::exists($destPath)) {
return true;
}
}
}
if (class_exists('Imagick') && !empty($magickPath) && ($imageEngine == 'auto' || $imageEngine == 'imagick')) {
if (JFile::exists($srcPath)) {
$thumb = $imagick = new Imagick($srcPath);
//$thumb->readImage($srcPath);
$format = $imagick->getImageFormat();
if ($format == 'GIF' && $gifAnimationPath) {
$gifAnimationPath = JPATH_ROOT.'/'.$gifAnimationPath; // get the absolute path
$imagick = $imagick->coalesceImages();
Sorry i cant provide that, it is against our information security policies. Also i have reviewed the source code and pointed out that it does not appear to be generating an image with the _animated.gif prefix when using the php exec command as i tried to explain. So basically it will only create an _animated.gif file if imagemagik is a php module because of the if else logic and missing code. I can possibly let you know the line pf code that is missing if i have time.
Hi,
I cant replicate this issue at my test site. so I need debugging this issue at your site.
it's hard for me to provide the fix if I cant access your site.
the code to created _animated.gif located at:
/components/com_community/controllers/photos.php line 2975
$params->set('animated_gif', str_replace($hashFilename.CImageHelper::getExtension($image['type']),$hashFilename.'_animated'.CImageHelper::getExtension($image['type']),$photoTable->image));