Opened 9 years ago

Closed 9 years ago

#793 closed task (fixed)

Implement thumbnails for PNG and JPG images

Reported by: Nicklas Nordborg Owned by: Nicklas Nordborg
Priority: critical Milestone: Thumbnails v1.0
Component: net.sf.basedb.thumbnails Keywords:
Cc:

Description


Change History (11)

comment:1 by Nicklas Nordborg, 9 years ago

(In [3399]) References #793: Implement thumbnails for PNG and JPG images

First working version that uses CSS to downsize the image to a fixed width/height. Not really what we want, but a starting point.

comment:2 by Nicklas Nordborg, 9 years ago

(In [3400]) References #793: Implement thumbnails for PNG and JPG images

Added 'imgsclar' library (http://www.thebuzzmedia.com/software/imgscalr-java-image-scaling-library/) to create thumbnails on the fly.

comment:3 by Nicklas Nordborg, 9 years ago

(In [3401]) References #793: Implement thumbnails for PNG and JPG images

Added support for thumbnails in different sizes.

Use the static cache for saving generated thumbnails. The cache key is generated from file id, version and thumbnail size.

comment:4 by Nicklas Nordborg, 9 years ago

(In [3402]) References #793: Implement thumbnails for PNG and JPG images

Making the thumbnails clickable to open the full image in a popup.

comment:5 by Nicklas Nordborg, 9 years ago

(In [3403]) References #793: Implement thumbnails for PNG and JPG images

Added a thumbnail also in the file view.

comment:6 by Nicklas Nordborg, 9 years ago

(In [3404]) References #793: Implement thumbnails for PNG and JPG images

Only scale images if the full image is larger than the thumbnail size.

Images with transparency are re-drawn on white background (otherwise they seem to either get a black or pinkish background)

The generated thumbnail is written as JPG using 0.9 for quality.

comment:7 by Nicklas Nordborg, 9 years ago

(In [3405]) References #793: Implement thumbnails for PNG and JPG images

Catch exceptions when generating the thumbnail and redirect to an error image.

comment:8 by Nicklas Nordborg, 9 years ago

(In [3409]) References #793: Implement thumbnails for PNG and JPG images

Re-designed the thumbnail generation on file view page. A real toolbar button is now used to act as a proxy for the image. The script will then inject the thumbnail image and hide the toolbar button. This change will make it possible to also inject thumbnail images in other pages than the file page.

comment:9 by Nicklas Nordborg, 9 years ago

(In [3421]) References #793: Implement thumbnails for PNG and JPG images

Add a "loading" animation as background image to thumbnails that have not yet loaded. To active this feature add 'loading' to the initial class name of the thumbnail image tag. This will be removed once the thumbnail has been loaded. It is also a good idea to add one of the size classes: small, medium, large or xlarge.

comment:10 by Nicklas Nordborg, 9 years ago

(In [3426]) References #793: Implement thumbnails for PNG and JPG images

Fixes a NullPointerException when a file doesn't have a MIME type.

comment:11 by Nicklas Nordborg, 9 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.