CMS MADE SIMPLE FORGE

CGSmartImage

 

[#9497] Image sent without file extension : issue ie in Fancybox

avatar
Created By: Eric Pesser (heriquet)
Date Submitted: Mon Aug 26 17:36:59 -0400 2013

Assigned To: Robert Campbell (calguy1000)
Version: 1.12
CMSMS Version: 1.11.7
Severity: Minor
Resolution: Invalid
State: Closed
Summary:
Image sent without file extension : issue ie in Fancybox
Detailed Description:
I got this if the image is modified by CGSI AND notag/noembed :

����JFIF��;CREATOR: gd-jpeg v1.0 (using IJG JPEG v80), quality = 75
��C    $.' ",#(7),01444'9=82<.342��C 
2!!22222222222222222222222222222222222222222222222222����"��
���}!1AQa"q2���#B��R��$3br�
%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz���������������������������������������������������������������������������
���w!1AQaq"2�B���� #3R�br�
$4�%�&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz��������������������������������������������������������������������������
?���(��(�C�m��_i&������3lC�S��:��k�� ���������˯7�.��P��kʮ~x����k
(Ihg�D�d\�b���^���C�

Here is the tag : 

<a class="group" href="{CGSmartImage
src=$image->file|escape:'url'|replace:'%2F':'/' filter_resize='w,980' notag=1
noembed=1 class=""}" rel="fancybox">{CGSmartImage src=$image->file
filter_resizetofit="320, 220"}</a>

First call is nok, second ok.

Did I miss something or is this a bug?

Thanks Robert! 


History

Comments
avatar
Date: 2013-08-28 10:15
Posted By: Robert Campbell (calguy1000)

See the fancybox parameters.  You have to tell fancybox to expect images.
      
avatar
Date: 2013-08-28 10:28
Posted By: Eric Pesser (heriquet)

Ok thanks a lot. 

I did not know this parameter
	'type'	        	:'image'

But why did you remove file extension?

Should it be possible to allow CGSI to keep the original file extension?


      
avatar
Date: 2013-08-30 04:58
Posted By: bess (bess)

yes i've got the same question : why ?  

because we still don't understand the benefit of the operation (may we miss some
good practices on internet ?)
      
avatar
Date: 2013-08-30 23:45
Posted By: Robert Campbell (calguy1000)

It's simple.

Once an image has been loaded, and gone through numerous transformations there
is no way of knowing in php, what the image type (and therefore the resulting
extension) should be (i.e:  bmp, png, gif, jpeg).

Browsers understand images without extensions, it's just some jquery libraries
that don't.   Therefore it's not a big deal to omit the file extension and let
the browser handle determining the type if it needs it).
      
avatar
Date: 2013-09-12 04:11
Posted By: Martin Malý (natrim)

when u dont have extension then u dont know what file it is when u try to
download it

or whene u want to set caching depending on file extension...

and there is way to know which type it should be in php, just save it with the
extension after the transformation or put select in config to define default
type for saving and convert it
      
Updates

Updated: 2013-09-12 10:12
state: Open => Closed

Updated: 2013-08-28 10:15
resolution_id: => 9
severity_id: 2 => 3