mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 02:40:53 -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 |
||
---|---|---|
.. | ||
backup_restore | ||
compression | ||
content_security_policy | ||
i18n | ||
imap/providers | ||
onebox | ||
seed_data | ||
site_settings | ||
validators | ||
webauthn | ||
bookmark_manager_spec.rb | ||
bookmark_query_spec.rb | ||
bookmark_reminder_notification_handler_spec.rb | ||
browser_detection_spec.rb | ||
content_security_policy_spec.rb | ||
db_helper_spec.rb | ||
discourse_js_processor_spec.rb | ||
encodings_spec.rb | ||
introduction_updater_spec.rb | ||
mini_sql_multisite_connection_spec.rb | ||
onebox_spec.rb | ||
search_spec.rb | ||
shrink_uploaded_image_spec.rb | ||
theme_flag_modifier_spec.rb | ||
theme_javascript_compiler_spec.rb | ||
topic_upload_security_manager_spec.rb | ||
upload_creator_spec.rb | ||
upload_recovery_spec.rb | ||
upload_security_spec.rb |