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_no_extension
image.svg FIX: add support for style element in SVGs 2019-02-07 12:09:06 +01:00
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 FEATURE: PWA compatibility checks in the Dashboard (#6850) 2019-01-09 08:46:11 +08:00
large_icon_incorrect.png FEATURE: PWA compatibility checks in the Dashboard (#6850) 2019-01-09 08:46:11 +08:00
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 correct specs 2018-08-20 12:46:14 +10:00
png_as.bin FIX: always test and coerce to image on upload 2018-08-20 12:18:59 +10:00
pngquant.png FEATURE: introduce lossy color optimization on resized pngs 2019-01-02 17:20:02 +11:00
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 FEATURE: do not switch to JPEG unless you meet 75k byte savings 2018-11-21 11:01:08 +11:00
smallest.ico FEATURE: Upload Site Settings. (#6573) 2018-11-14 15:03:02 +08:00
smallest.png FIX: Moving upload to tombstone should update modification time. 2018-09-18 10:48:29 +08:00
svg.png Add spec for 4bf3bf6786. 2018-07-26 09:16:14 +08:00
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 Drop tif, tiff, webp and bmp from supported images. 2018-09-12 09:29:54 +08:00
zero_sized.svg FIX: Allow SVG uploads if dimensions are a fraction of a unit (#13409) 2021-06-17 15:56:11 -04:00