Used the Python Imaging Library (with JPEG decoder) to create set of thumbnails. For the images with jpeg extension, the error pops up that the properties can't be retrieved, while for the non-image extensions, everything displays fine.
Is this a problem with PIL not generating enough header information about
the image, or something else? Size-wise, .thumbnail is 4x smaller, but the
quality is really low. The original JPG displays fine too...
thumbnails resizing:
...
im = Image.open(infile)
im.thumbnail(size)
im.save(outfile, "JPEG")
displaying images:
{{
img1 =
'product.image.85d32040405f61e9.626c61636b2d6e616d6d752e6a7067.thumbnail180x160'
img2 =
'product.image.85d32040405f61e9.626c61636b2d6e616d6d752e6a7067.180x160.jpeg'
}}
<!--<img src="{{#=URL('download', args=img1, scheme=True, host=True)}}"-->
<img src="{{=URL('download', args=img2, scheme=True, host=True)}}"
Traceback (most recent call last):
File "/Users/adnan/web2py26/gluon/restricted.py", line 217, in restricted
exec ccode in environment
File "/Users/adnan/web2py26/applications/nammu/controllers/default.py",line
2983, in <module>
File "/Users/adnan/web2py26/gluon/globals.py", line 361, in <lambda>
self._caller = lambda f: f()
File "/Users/adnan/web2py26/applications/nammu/controllers/default.py",line
2105, in download
return response.download(request, db)
File "/Users/adnan/web2py26/gluon/globals.py", line 574, in download
(filename, stream) = field.retrieve(name,nameonly=True)
File "/Users/adnan/web2py26/gluon/dal.py", line 9558, in retrieve
file_properties = self.retrieve_file_properties(name,path)
File "/Users/adnan/web2py26/gluon/dal.py", line 9583,
inretrieve_file_properties
raise TypeError('Can\'t retrieve %s file properties' % name)
TypeError: Can't retrieve
product.image.85d32040405f61e9.626c61636b2d6e616d6d752e6a7067.180x160.jpeg
file properties
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.
product.image.85d32040405f61e9.626c61636b2d6e616d6d752e6a7067.thumbnail180x160
Description: Binary data
<<attachment: product.image.85d32040405f61e9.626c61636b2d6e616d6d752e6a7067.180x160.jpeg>>

