discourse/spec/fixtures/images
jbrw fbfd1fd80b
FIX: Allow SVG uploads if dimensions are a fraction of a unit (#13409)
* 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
2021-06-17 15:56:11 -04:00
..
vanilla_import FIX: improve Vanilla importing (#10478) 2020-08-24 16:19:57 -04:00
animated.gif FIX - don't attempt to optimized animated images (#11031) 2020-10-26 15:10:19 -04:00
animated.webp FIX: Use ImageMagick to detect animated images (#11702) 2021-01-13 19:01:30 +02:00
cropped.png
custom-theme-icon-sprite.svg DEV: Ignore SVG sprite symbols missing ids 2019-03-18 22:07:19 -04:00
downsized.png
fake.jpg
fake.long-FileExtension FIX: Be able to handle long file extensions (#12375) 2021-03-17 12:01:29 -06:00
fake.not_image FIX: allow underscore in file extension while downloading the uploads. 2020-01-03 10:09:07 +05:30
huge.jpg SECURITY: return error on oversized images 2020-09-14 10:45:11 +10:00
image.svg
image_no_extension
large_and_unoptimized.png FIX: should_alter_quality should respect png_to_jpg_quality (#12055) 2021-02-12 13:37:35 -05:00
large_icon_correct.png
large_icon_incorrect.png
logo-dev.png
logo.jpg FEATURE: Automatically generate optimized site metadata icons (#7372) 2019-05-01 14:44:45 +01:00
logo.png
massive.svg FIX: Allow SVG uploads if dimensions are a fraction of a unit (#13409) 2021-06-17 15:56:11 -04:00
not_an_image
png_as.bin
pngquant.png
resized.png
should_be_jpeg.heic FEATURE: Support converting HEIF images to JPEG (#10079) 2020-07-22 21:40:09 -04:00
should_be_jpeg.png
smallest.ico
smallest.png
svg.png
tiff_as.bin FIX: Consider webp a supported image format for upload (#9015) 2020-02-21 13:08:01 +10:00
tiny.svg FIX: Allow SVG uploads if dimensions are a fraction of a unit (#13409) 2021-06-17 15:56:11 -04:00
webp_as.bin
zero_sized.svg FIX: Allow SVG uploads if dimensions are a fraction of a unit (#13409) 2021-06-17 15:56:11 -04:00