UploadCreator counts the number of pixels in an file to determine if it is valid.
pixels is calculated by multiplying the width and height of the image, as determined by FastImage.
SVG files can have their width/height expressed in a variety of different units of measurement. For example, ‘px’, ‘in’, ‘cm’, ‘mm’, ‘pt’, ‘pc’, etc are all valid within SVG files. If an image has a width of
0.5in, FastImage may interpret this as being a width of
0, meaning it will report the
size as being
However, we don’t need to concern ourselves with the number of ‘pixels’ in a SVG files, as that is irrelevant for this file format, so we can skip over the check for
pixels == 0 when processing this file type.