Page 1 of 1
CGSmartImage images are not images anymore?
Posted: Wed Oct 23, 2013 8:04 pm
by urheat
After updating CGSmartImage to the latest version 1.13 the images that are resized using CGSmartImage are not "images" anymore but "application/octet-stream"?!
Example:
When using Firefox and if I try to view the image that is resized using CGSmartImage, I can't see the image. I'll get an "Save as" dialog which says that if I want to save "application/octet-stream". With Firefox, I can save the image normally.
IE doesn't allow me to view the image and if I try to save it, I'll get an error message.
Not a huge problem, but annoying and ruins a bit the UI.
Re: CGSmartImage images are not images anymore?
Posted: Wed Oct 23, 2013 11:09 pm
by calguy1000
CGSmartImage no longer uses file extensions. However, I just tested (both with and without data URI's) and the file is still interpreted properly as an image, and identified with the proper mime type.
Maybe your .htaccess is messing stuff up. Try using the stock one shipped with CMSMS.
Re: CGSmartImage images are not images anymore?
Posted: Thu Oct 24, 2013 12:47 am
by applejack
calguy1000 wrote: I just tested (both with and without data URI's)
That may depend on your servers configuration. On mine without the data URI they don't work. Any idea as to what Apache's mime types may need configuring.
Re: CGSmartImage images are not images anymore?
Posted: Fri Oct 25, 2013 4:02 am
by urheat
calguy1000 wrote:CGSmartImage no longer uses file extensions. However, I just tested (both with and without data URI's) and the file is still interpreted properly as an image, and identified with the proper mime type.
Maybe your .htaccess is messing stuff up. Try using the stock one shipped with CMSMS.
Thanks calguy!
May I ask why it don't uses file extensions? Can I set module so, that it uses file extensions?
I just updated all my CMSMS sites to 1.11.9 and there was a .htaccess file. So it is "a stock version".
Hopefully the case isn't that, I to have modify htaccess-files, 'cause I think that the modules should work out of the box without tweaking htaccess configurations. a) sometimes the host won't allow it b) resizing images is pretty basic feature that should work easily.
Re: CGSmartImage images are not images anymore?
Posted: Fri Oct 25, 2013 4:28 am
by calguy1000
CGSI no longer uses file extensions primarily because the various filters could result in a jpeg image being converted to a png or vise versa... which had already been reported as a bug. So, no file extension == no bug.
There is nothing in the stock htaccess.txt file that would interfere with CGSI. I asked you to 'check' your .htaccess files incase there were some non-stock rules that may cause problems.
The sample htaccess.txt file shipped with CMSMS was changed in 1.11.9 to expire images at different times based on their mime types instead of their file extension, but that only effects the expiry header.
I verified on a CGSI test page, that with the noembed=1 parameter enabled that the mime-type interpreted by the browser (chrome on linux) was correct.
Re: CGSmartImage images are not images anymore?
Posted: Fri Oct 25, 2013 4:45 am
by urheat
calguy1000 wrote:CGSI no longer uses file extensions primarily because the various filters could result in a jpeg image being converted to a png or vise versa... which had already been reported as a bug. So, no file extension == no bug.
Ok. I presume that the module is used for image resizing a lot more than filtering images, so I would assume that if there have to be made a decision based on that, I would choose that there would be file extensions or at least an option to force them.
calguy1000 wrote:There is nothing in the stock htaccess.txt file that would interfere with CGSI. I asked you to 'check' your .htaccess files incase there were some non-stock rules that may cause problems.
The sample htaccess.txt file shipped with CMSMS was changed in 1.11.9 to expire images at different times based on their mime types instead of their file extension, but that only effects the expiry header.
I really don't know what to check. And I haven't modified the htaccess-file. Should I copy htaccess.txt to root .htaccess?
calguy1000 wrote:I verified on a CGSI test page, that with the noembed=1 parameter enabled that the mime-type interpreted by the browser (chrome on linux) was correct.
If you mean that Chrome on Linux allows user to use the image as it should (view & download it), then based on my testing, it doesn't work on more commonly used environments like Windows & Chrome, Firefox and IE.
Re: CGSmartImage images are not images anymore?
Posted: Fri Oct 25, 2013 4:57 am
by calguy1000
Tested in Firefox too.... response mime type is appropriate.
Re: CGSmartImage images are not images anymore?
Posted: Fri Oct 25, 2013 5:07 am
by urheat
calguy1000 wrote:Tested in Firefox too.... response mime type is appropriate.
On Linux?
Re: CGSmartImage images are not images anymore?
Posted: Fri Oct 25, 2013 6:18 am
by urheat
I made some testing. Couldn't change the language of the browsers, but I'll explain the results.
I installed fresh 1.11.9 and CGSmartImage module. I resized hockey picture using the module.
Firefox & Windows 7
- Can't view the image. Gives option to save the stream.
- I can save the image as jpg.
Chrome & Windows 7
- Can't save the image. I can save it as txt-file.
IE & Windows 7
- Can't view the image.
- Can't save the image. Error is "denied or not recognized file extension"
Firefox & Mac 10.7.5
- Same as Windows
Chrome & Mac 10.7.5
- Same as Windows.
You are free to test yourself:
http://ihmis.web29.neutech.fi/
Hopefully this helps and this bug is fixed in next release.
Re: CGSmartImage images are not images anymore?
Posted: Fri Oct 25, 2013 1:14 pm
by Jo Morg
I checked your link on Windows 7 64:
Opera V12.16 and Firefox V24.0 and both worked as they should. I could see the image and download it as jpg.
IE9 I could see but save was blocked with the message: "The file type being saved or retrieved has been blocked". A typical cryptic MS message that explains nothing.
On Chrome V27, the image shows and can be saved correctly but I have to change the extension from*.txt to *.jpg manually.
Not offering a solution, just adding some more data to see if it helps sorting it.