Search

A new Extension, “Just In Time (JIT) Image Manipulation” is now available for download. Comments and feedback can be left here but if you discover any issues, please post it on the issue tracker.

Question: I updated a Symphony install and the JIT extensions to the latest GitHub code today. For some reasons the image manipulation stopped working. I have other installs on the same server that are working and the .htaccess seems to be fine. The trusted sites list is empty.

Is there anything that changed in the latest JIT version that might break the extension?

Nils wasn’t there something about removing anything before the /extensions/ part of the url string in the htaccess file? I might be thinking of jcrop and the image crop extension though.. worth checking!

Same problem here. I turned on error displaying in extension:

Fatal error: Call to undefined method Lang::init() in /Users/icek/Sites/tests/www/extensions/jit_image_manipulation/lib/image.php on line 21

Aha - that makes sense. Lang::init() doesn’t exist anymore in Symphony 2.0.7 so it should be replaced by Lang::load().

hmm, I’ve changed Lang:init() to Lang::load() and have some timezone related warnings and folowwing error:

Fatal error: Call to a member function applyFilter() on a non-object in /Users/icek/Sites/tests/www/extensions/jit_image_manipulation/lib/image.php on line 202

My fault, I’ve used wrong parameters. Works now :)

For compatibility with 2.0.7RC2, there is this fix as pointed out by Nils.

My apologies. This fix has been pulled into the official repo.

Does JIT cache images? If so, why and where?

I removed an image from workspace/images but the image continued to be displayed. I did hard refreshes and even cleared the FireFox cache but the image still showed. I then took the JIT parameters out of the URL (thus bypassing JIT) and the image didn’t show. I put the JIT parameters back and the image reappeared.

EDIT: Well, after reading the intro paragraph of the JIT documentation I found that the answer to my first question is yes, and the “why” is probably to save processing time. But where are they cached and how can I clear it?

Does JIT cache images? If so, why and where?

Yes. For performance.

The cached versions of images reside in /manifest/cache. The latest version of JIT also forces images to be cached in your browser for better performance. So even if the original image has been removed, your cached versions remain intact.

Thanks Nick. I was typing an edit while you were responding. And I should have thought to look under manifest.

The JIT Image Manipulation doesn’t work for me when applying the image path as described in http://getsymphony.com/learn/concepts/view/jit-image-manipulation/

examples:

/ image / e / path

/ image / 1 / w / h / e / path

It started to work when I removed the /e from the path.

I am not sure if it is a bug in the extension or in the documentation.

So even if the original image has been removed, your cached versions remain intact.

This is cached by the browser, bt what happens when an image hosted at ea flickr (pulled in via a stream) goes offline at flickr. Does JIT keeps the ‘last seen’ image in the cache folder, and as such acts as a full blown backup system for your cloud images?

or doesnt JIT still doesnt cache external images, if so why was that exactly?

@rzelnik: parameter e - External (Optional) 0 or omitted for internal images. 1 for external images.
So if you don’t use images from external services simply ommit this. If you are using them, add external sites in preferences.

@icek: thanks for explanation. I should read the documentation carefully next time. :)

When I have a URL like:

/image/2/300/200/5/1/www.external.com/generateImage.jpg?token=123&id=456

the parameters don’t get submitted. I could temporary fix this by adding the following to line 81-86 in lib/image.php:

// Check for optional parameters:
$uri = $_SERVER['REQUEST_URI'];
$a = explode('?', $uri);
if(count($a) == 2) {
    $param->file.= '?'.$a[1];
}

PS:

some services don’t provide an extension and in that case JIT doesn’t work (since it filters on extension in the .htaccess-file. Think of something like:

/image/2/300/200/5/1/www.external.com/generateImage?token=123&id=456&output=jpg

I filed an issue for this, since I think this is something that should be looked at.

…And is there an option for caching external images?

I’m trying to use the extension with some photos from Flickr. But, how do I remove the http:// from the url?

My HTML:

<img src="{$root}/image/2/460/460/5/1/{./@url_o}"/>

My XML (via Flickr API):

<photo url_o="http://farm6.static.flickr.com/5169/5365445615_1d5e00da7e_o.jpg" height_o="1000" width_o="667"/>

You can use the substring-after function:

{substring-after(./@url_o, 'http://')}

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details