Page 1 of 1

CGSmartImage with Fancybox returns corrupt file

Posted: Mon Aug 12, 2013 1:56 pm
by rodfarias
Hello.
I'm trying to implement a gallery of images with CGSmartImage and jquery Fancybox. Documentation for CGSmartImage give the following example, including any filters:

Code: Select all

<a rel='simple_album' class="fancybox" href="{CGSmartImage src=$file notag=1 noembed=1}">
{CGSmartImage src=$file}
</a>
The thumbnail is generated OK, but the large file is not displayed in the popup as an image, but as a ugly sequence of characters.
The problem is that Fancybox displays correctly the file if you provide the appropriate extension (jpg, png ...), but CGSmartImage sent from its cache a renamed file without any extension.
My solution was to skip CG for large image and leave the code like this:

Code: Select all

<a rel='simple_album' class="fancybox" href="{CGSmartImage src=$file notag=1 noembed=1}">
<img href="{$file}" />
</a>
However, I want to know what mistake I'm making and why the example of the documentation not works, in order to use CG with both images.

Thanks.

Re: CGSmartImage with Fancybox returns corrupt file

Posted: Mon Aug 12, 2013 3:23 pm
by calguy1000
set the fancybox 'type' property to 'image'.
fancybox uses the file extension to try to determine a type.

Re: CGSmartImage with Fancybox returns corrupt file

Posted: Mon Aug 12, 2013 4:14 pm
by rodfarias
Great!
It solved.
Thank you very much.