# Les images SVG avec une dimension inférieure à 1 échouent à l'upload

**URL:** <https://meta.discourse.org/t/svg-images-with-dimension-less-than-1-fail-to-upload/194009>\
**Category:** Bug\
**Created:** [Juin 16, 2021, 5:08 UTC](https://meta.discourse.org/t/svg-images-with-dimension-less-than-1-fail-to-upload/194009 "2021-06-16T05:08:20Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![jamie.wilson](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jamie.wilson/32/185466_2.png) [@jamie.wilson](https://meta.discourse.org/u/jamie.wilson)\
**Post date:** [Juin 16, 2021, 10:11 UTC](https://meta.discourse.org/t/svg-images-with-dimension-less-than-1-fail-to-upload/194009/4 "2021-06-16T22:11:21Z")

</div>

> [@µMerlin](#):
>
> En supposant que la bibliothèque fastimage soit corrigée, il faudra probablement encore modifier Discourse pour intégrer la version mise à jour.

Merci pour la description détaillée du problème.

J’ai réussi à reproduire le problème de mon côté et je pense que cette demande de fusion devrait résoudre le problème que vous décrivez.

> <https://github.com/discourse/discourse/pull/13409>
>
> \`UploadCreator\` counts the number of pixels in an file to determine if it is val…id. \`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.

Édit : Étrange… les tests passent chez moi en local, mais échouent après que je les ai poussés. Je m’en occuperai demain.

---

_[View the full topic](https://meta.discourse.org/t/svg-images-with-dimension-less-than-1-fail-to-upload/194009)._
