Notice

The forum is in read only mode.

Support Forum

Welcome! Support Forums have been reactivated
Welcome the Technical Support section. Help us in assisting you by providing us with a concise and descriptive elaboration of your issues. Be specific and if possible, provide us with a step-by-step instruction in replicating your problem.

Path to ImageMagick

8 years 10 months ago
Licenses:
JomSocial Active iSEO Expired Socialize Expired

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

8 years 10 months ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

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

8 years 10 months ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

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')){
replace to :
$magickPath = $config->get('magickPath');
 
             if($isGifAnimation && !class_exists('Imagick') && empty($magickPath)){

If you want to know the imagick path you can ask your sys-admin, or type "whereis convert" from your command form.

thank you

8 years 10 months ago
Licenses:
JomSocial Active iSEO Expired Socialize Expired

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.

8 years 10 months ago
Licenses:
JomSocial Active iSEO Expired Socialize Expired

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;
                }
            }
        }

WHEREAS if you have imagemagick installed as a php module there is additional code that will generate the images with the _animated.gif ending that I can see here on line 192.
        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();

So the if statement that uses the exec() option just seems to be incomplete, it does not account for the animated gif on lines 224 to line 245.

Not a gigantic issue but figured pointing this out wouldnt hurt

8 years 10 months ago
Licenses:

Hi,

please provide me super user login detail for staging site.
and I need FTP access too.
you can put credential information by editing your first post at this topic and put it at site info form. it's private

Regards

8 years 10 months ago
Licenses:
JomSocial Active iSEO Expired Socialize Expired

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.

8 years 10 months ago
Licenses:

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));

I want to make a sure where animated.gif located at your server.

Regards

Moderators: Piotr Garasiński
Powered by Kunena Forum

Join 180,000 websites creating Amazing communities

JomSocial is the most complete, easy-to-use addon that turns Joomla CMS into a
full -fledged, social networking site

TRY NOW BUY NOW