discourse/spec
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
..
components DEV: Revert 3 commits for plugin API to add directory columns (#13423) 2021-06-17 12:37:37 -05:00
fabricators DEV: Add SMTP group ID to EmailLog (#13381) 2021-06-15 11:29:46 +10:00
fixtures FIX: Allow SVG uploads if dimensions are a fraction of a unit (#13409) 2021-06-17 15:56:11 -04:00
helpers A11Y: sets the html lang to user's locale when possible (#12007) 2021-02-10 16:12:09 +01:00
import_export FEATURE: Rake task to export groups (#9450) 2020-04-17 14:59:54 -07:00
initializers FEATURE: A low priority filter for the review queue. (#12822) 2021-04-23 15:34:24 -03:00
integration FEATURE: Add global admin api key rate limiter (#12527) 2021-06-03 10:52:43 +01:00
integrity DEV: Fix a flaky Onceoff spec (#13314) 2021-06-07 20:38:31 +02:00
jobs FIX: Make sure topic_user.bookmarked is synced in more places (#13383) 2021-06-16 08:30:40 +10:00
lib FIX: Allow SVG uploads if dimensions are a fraction of a unit (#13409) 2021-06-17 15:56:11 -04:00
mailers FIX: Do not enqueue :group_smtp_email job if IMAP disabled for the group (#13307) 2021-06-07 14:17:35 +10:00
models FIX: Make sure reset-new for tracked is not limited by per_page count (#13395) 2021-06-17 08:20:09 +10:00
multisite FEATURE: Use path from existing URL of uploads and optimized images (#13177) 2021-05-27 17:42:25 +02:00
requests DEV: Revert 3 commits for plugin API to add directory columns (#13423) 2021-06-17 12:37:37 -05:00
script/import_scripts DEV: If disabled do not change setting after import (#12142) 2021-02-19 09:33:35 -07:00
serializers Revert "PERF: Cache categories in Site model." 2021-06-17 15:20:35 +08:00
services FIX: Destroy invites of anonymized emails (#13404) 2021-06-17 10:45:40 +03:00
support FIX: Make sure reset-new for tracked is not limited by per_page count (#13395) 2021-06-17 08:20:09 +10:00
tasks FIX: remove migrate_from_s3 task that silently corrupts data (#11703) 2021-01-17 22:33:29 +01:00
views/omniauth_callbacks FEATURE: Use full page redirection for all external auth methods (#8092) 2019-10-08 12:10:43 +01:00
rails_helper.rb DEV: Absorb onebox gem into core (#12979) 2021-05-26 15:11:35 +05:30
swagger_helper.rb api docs example (#11997) 2021-02-08 10:09:44 -07:00