Link | isJPEG |
Author | Kyle Jessup |
Category | Image |
Version | 8.x |
License | Public Domain |
Posted | 27 Jul 2006 |
Updated | 27 Jul 2006 |
More by this author... |
This tag reads the image type marker contained in every JPEG file to confirm that the file is indeed a JPEG image. This tag will confirm JPEGness regardless of the extension of the file. This tag assumes that it has permission to read the file in question. All JPEG image files contain a marker which looks like so: JFIF. This tag looks for that marker. This tag may return the wrong answer if the file contains that marker and is not an actual JPEG image file.
isJPEG('/path/to/image.jpg'); // true isJPEG('/path/to/file.txt'); // false
Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.
define_tag('isJPEG', -required='path'); protect; return: file(#path)->setPosition(7) & read(4) == 'JFIF'; /protect; return:false; /define_tag;
No comments
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft