measure. Creating an object based on existing graphics file

^image::measure[file;options] [3.4.6]

Creates an object of class
image, measuring dimensions of an existing graphics file or an object of class file in supported format. Parser supports GIF, JPEG and PNG, and starting from version [3.4.6] additionally supports TIFF, BMP, WEBP and with $.video(true) option supports MP4 (MOV) video.

The picture itself is not used-the constructor only keeps in memory the dimensions and the name of the file. The main purpose of the method is to determine dimensions and, for example, the subsequent method
html call for the created object.

file-object of class file
filename-filename with path

Options hash can be specified:

To measure the dimensions of MP4 (MOV) video files.
To read the EXIF information ( stored in JPEG files. Before version [3.4.6] EXIF information was read always.
To read the XMP information ( stored in JPEG files.
The charset of XMP information.

$ .video (false / true) - additional size of video files in MP4 format (MOV). By default, no preset.
$ .exif (false / true) - additionally read EXIF information () from JPEG files. By default, not read (up to version 3.4.6 EXIF information was read all the time).
$ .xmp (false / true) - additionally read XMP information () from JPEG files. Do not read by default.
$ .xmp-charset [coding] - coding XMP information. By default UTF-8.

Note: supports EXIF 1.0 and reads tags IFD0 and SubIFD, if any.

Example of creating tag IMG with width and height attributes

will create object photo of class image, based on existing graphics in PNG format. Tag IMG will be created with reference to the file and width and height specified.

Example of working with EXIF information
$image[^image::measure[jpg/DSC00003.JPG; $.exif(true) ]]
    Camera manufacturer, model$exif.Make $exif.Model<br />
    Shooting time^exif.DateTimeOriginal.sql-string[]<br />
    Exposure time$exif.ExposureTime seconds<br />
    Aperture: F$exif.FNumber<br />
    Flash used^if(def $exif.Flash){^if($exif.Flash){yes;no};not known}<br />
    No EXIF information<br />

Copyright © 1997–2021 Art. Lebedev Studio | Last updated: 25.01.2021