Details
-
Bug
-
Resolution: Fixed
-
Major
-
3.5, 4.0
-
Tomcat 7, Windows XP, Java 6
-
Unit
-
Unknown
-
n/a
-
n/a
-
Description
The ImagePlugin re-creates thumbnail temporary files on every request, despite the fact that the original image and thumbnail image content may be cached.
The ImagePlugin.downloadImageFromCache method caches the thumbnail after is is resized by the shrinkImage() method, but on subsequent requests the
XWikiAttachment is cloned and the .setContent(InputStream,int) method set from the cached data which causes a new temporary file to be created every time.
Right now it serves the bytes to the client by:
- Getting the image bytes from the cache
- writing those cached bytes out to disk from the cache by re-creating a new temporary file (unless the memory file size threshold was not reached - 10kb)
- Re-reading those image bytes from the file via the DiskFileItem to serve to the servlet response.
If a page has multiple images (eg. 20+ images) shown as thumbnails then the disk space consumed can start to grow fairly quickly.
Could the cached bytes be used directly instead of re-creating a new temporary file?
Attachments
Issue Links
- relates to
-
XWIKI-8663 Image attachments are not scaled any more when the image dimensions are specified on the download request
- Closed