compass-uk on DeviantArthttps://www.deviantart.com/compass-uk/art/DeviantART-PhotoAlbum-II-299003777compass-uk

Deviation Actions

compass-uk's avatar

DeviantART PhotoAlbum II

By
Published:
1.2K Views

Description

I liked the look of Samy's DeviantART PhotoAlbum widget ( [link] ) but it resized and cropped the images to fit the size of the widget as you set it.

As I wanted to see the whole image in the PhotoAlbum all the time, I initially tweaked the image parameter to "Image fit size" rather than "Image fit size and full", but sometimes the image ended up too small.

So I added some additional javascript to process the image size, and a couple of new menu items so now the widget resizes itself to suit the image it is currently displaying.

All the original functions are maintained;
• Double click to next photo.
• Right click to change folder or set photo album settings.
• Drag right-bottom corner to resize.

The two additional menu items are Constrain Horizontal and Constrain Vertical. After you resize the widget to the desired size, these menu options prevent the widget from enlarging in the constrained aspect; for instant, Constrain Vertical (the default setting) means that when resizing, it can only do so horizontally as the vertical aspect is constrained.

To retrieve the image dimensions, I added these to the image name via a file renaming utility (I use RenameMaster). Each image has it's dimension in braces separated by a comma, so an image that was 900 by 600 pixels would have "{900,600}" as part of it's filename.
There may be a way to do this without adding the dimensions to the filename, but not yet.

Without image size values on the filename, the widget just fits the image into it's current size.
© 2012 - 2024 compass-uk
Comments2
Join the community to add your comment. Already a deviant? Log In
pigboat's avatar