Script Summary: Display images with their original sizes, and show images' metadata such as EXIF.
This script displays any image with its original size in the center of the window, with darkened background (in the "display mode"), by moving mouse over it while holding the shift key. The display mode is terminated by clicking on the image or the background. If the window size is smaller than the original image, the original image is resized to fit in the window, thus no scroll is needed.
When an image is resized (displayed width and height differ from its original geometry), green or red borders may be applied. By default, green border is for shrinked images and red border is for enlarged images.
The displayed image can also be zoomed in/out using the mouse wheel.
In the display mode, the metadata of the displayed image is shown in a tooltip, including file size, geometries and EXIF if available, by holding the shift key. The tooltip will be hidden if release the shift key. The metadata is retrieved from the IMG·2·JSON service.
Normally the default values of these options work fine. You do not need to change them.
- modifier: the key required to be held when move mouse over to enter the display mode and show the metadata tooltip. Possible values are "ctrl", "alt", "shift" and "meta". Setting to any other value will bypass the hold requirement. (default shift key)
- img_min_length: only tracks images whose width AND height are both greater than this value. (default 20px)
- img_margin: size of the margin to the edges of window for the initial view of displayed image. (default 40px)
- bg_color: the background color for both image display and metadata tooltip. (default black)
- bg_opacity: the opacity for both the background and the metadata tooltip. (default 61.8%, the golden ratio)
- border_width: border width of the resized images. (default 1px)
- border_style: CSS border style of the resized images. (default solid)
- border_color_shrinked: border color of resized images which are shrinked. (default green)
- border_color_enlarged: border color of resized images which are enlarged. (default red)
- zoom_step_ratio: increment ratio to the current height when zooming the original image. (default 0.2)
- zoom_min_height: the minimal height the original image can be zoomed out. If the original image's height is less than this value, use the image's height as the lower bound. (default 200px)
- auto_adjust: auto adjust the width and height of the displayed image to the current window. (default Enabled)
- check_resize: whether or not check if the image is resized or not. (default Check)
- check_min_area: the minimum area size of the images that will be decorated with border if resized. Applies to both the original and displayed area. Set to 0 to disable this check. (default 400 square px)
- check_min_diff: the minimum area size difference between the original and displayed area of the images that will be decorated with border if resized. Consisted of integer and decimal parts. The integer part indicates the absolute value of the area difference. The decimal part indicates the resize ratio based on the larger one from the original and displayed area. Set either part to 0 to disable the corresponding check. Do not set the whole value to 0, or otherwise nearly all images will be decorated borders. (default 400.1)
The border is applied to an image only if all three checks from the check_min_area and check_min_diff option are passed.
Here are some examples about the effectiveness of check_min_area and check_min_diff may options:
|Original geometry||Displayed geometry||Has border?||Reason|
|15 x 15 (225)||20 x 20 (400)||No||The script firsly checks the check_min_area option. By default, all images with less than 400 square px area will not be bordered. The original area 225 is less than 400.|
|20 x 20 (400)||15 x 15 (225)||No||The check_min_area option applies to both original and displayed area.|
|40 x 30 (1200)||35 x 24 (840)||No||The script then checks the check_min_diff option. By default, if the difference between the two areas is less than 400 (integer part of check_min_diff), the image will not have border. 1200 - 840 = 360 is less than 400. This means the image is only slightly resized. The script does not guarantee same aspect ratio.|
|390 x 290 (113100)||400 x 300 (120000)||No||For large images, the absolute value of area difference may not be useful. The script also checks the decimal part of the check_min_diff option. The larger area between the two is the displayed area, the area difference is 120000 - 113100 = 6900, and the resize ratio is 6900 / 120000 = 0.0575. Be default, the image is ignored if this ratio is less than 0.1.|
|380 x 280 (106400)||400 x 300 (120000)||Yes||This image passes all three checks, and will be decorated border.|
|This is a shrinked image:|
|This is an enlarged image:|
|This is a normal image:|
|This is a shrinked image with EXIF:|
Some images' EXIF will not be shown, even they have EXIF. This is due to the IMG·2·JSON service. Unless either I change the EXIF reading mechanism in future versions, or IMG·2·JSON updates its algorithm, this issue will remain.
1.3.5 on 12/24/2009:
- fix a bug about the geometry of the background.
1.3.4 on 07/31/2009:
- replace check_min_edge option with check_min_area option.
- add check_min_diff option.
1.3.3 on 07/30/2009:
- check_min_edge checks both source and target geometries.
1.3.2 on 06/08/2009:
- Add the minimum length of the edges the images should be checked for resize.
1.3.1 on 06/06/2009:
- Display error messages when fail to request image metadata.
1.3 on 06/06/2009:
- When displaying images, use the modifier key to show images' metadata.
- Avaiable to display any image.
- It is optional to check if the image is resized or not. Use check_resize option to toggle.
- Minor changes, clean deprecated options.
1.2.8 on 06/05/2009:
- Fix bug when auto_adjust is set to false, zooming does not work.
1.2.7 on 06/01/2009:
- Add auto adjust option. Enabled by default.
1.2.6 on 05/03/2009:
- Only track images whose width AND length are both greater than the specified threshold (see options).
1.2.5 on 05/03/2009:
- Show and hide the displayed image rather than re-create and hide.
- Zoom displayed image by fraction of its current height, not absolute pixels.
- Different border color for shrinked and enlarged images.
- Track images only if they meet the minimal image resize ratio.
1.2 on 05/01/2009:
- Add keyboard modifier option.
- Fix problem that cached and resized images are not able to display.
- Fix wrong position of original image if window is scrolled.
- Zoom/close original image by wheeling/clicking anywhere in the window.
- Minor changes.
1.1 on 04/30/2009:
- Zoom in/out original image with mouse wheel.
1.0 on 04/30/2009:
- Initial version.