GAS Library - ImgApp - getSize()

1. getSize()

Overview

This method is for retrieving the width and height of image as the unit of pixel.

Description

Unfortunately, there are no methods to directly retrieve the image size at Google Apps Script. As a workaround, there is a method that it imports the image in Google Document and retrieves the size using getWidth() and getHeight(). But in this method, it uses much time and resources on Google. So I thought of retrieving the information of image at the binary level, and created this. By this, the low process cost could be achieved.

Demo

This is a demonstration for this method. the size information is retrieved from BMP, GIF, PNG and JPG files. The play speed is the real time. From this demo, you can see the speed for retrieving the size information from files.

This sample image is created by k3-studio.

You can see the detail information here https://github.com/tanaikech/ImgApp

 Share!