mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 12:13:58 -06:00
fbfd1fd80b
* FIX: Allow SVG uploads if dimensions are a fraction of a unit `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 `0`. 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. * DEV: Speed up getting SVG dimensions The `-ping` flag prevents the entire image from being rasterized before a result is returned. See: https://imagemagick.org/script/command-line-options.php#ping |
||
---|---|---|
.. | ||
vanilla_import | ||
animated.gif | ||
animated.webp | ||
cropped.png | ||
custom-theme-icon-sprite.svg | ||
downsized.png | ||
fake.jpg | ||
fake.long-FileExtension | ||
fake.not_image | ||
huge.jpg | ||
image_no_extension | ||
image.svg | ||
large_and_unoptimized.png | ||
large_icon_correct.png | ||
large_icon_incorrect.png | ||
logo-dev.png | ||
logo.jpg | ||
logo.png | ||
massive.svg | ||
not_an_image | ||
png_as.bin | ||
pngquant.png | ||
resized.png | ||
should_be_jpeg.heic | ||
should_be_jpeg.png | ||
smallest.ico | ||
smallest.png | ||
svg.png | ||
tiff_as.bin | ||
tiny.svg | ||
webp_as.bin | ||
zero_sized.svg |