[Document] fix: keep company logo aspect ratio in ODT documents - #1400
Open
evarisk-kilyan wants to merge 1 commit into
Open
[Document] fix: keep company logo aspect ratio in ODT documents#1400evarisk-kilyan wants to merge 1 commit into
evarisk-kilyan wants to merge 1 commit into
Conversation
The company logo was inserted in ODT documents through setImage() using the forced _mini thumbnail and with no bounding box, so a wide logo ended up rendered as a flattened, low-resolution strip in the document header (e.g. the DoliMeet attendance sheet — "logo écrasé"). Insert the logo from the sharper _small thumbnail and scale it into a 128x72 px bounding box (the previous _mini footprint) while preserving its aspect ratio via setImage()'s $ratio parameter. Photos and pictos keep their previous behavior. Refs Evarisk/dolimeet#803 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contexte
Refs Evarisk/dolimeet#803 (« logo écrasé feuille de présence »)
Le logo société était inséré dans les documents ODT via
setTmpArrayVars():_mini(≤128×72 px, basse résolution) àmodules_saturne.php:909;setImage($key, $val)sans boîte englobante.Résultat : un logo large (ex. ellipse) est rendu en fine bande aplatie et pixelisée dans l'en-tête (cf. la feuille de présence DoliMeet). Contrairement aux signatures (gérées juste en dessous), le logo n'avait aucune maîtrise de taille/ratio.
Correctif
Dans
SaturneDocumentModel(core/modules/saturne/modules_saturne.php) :_mini) en conservant le ratio, via le 3ᵉ paramètre$ratiodesetImage()(déjà supporté parOdfetSegment). Les clésphoto/pictogardent leur comportement._small→_mini: on garde la miniature_small(plus nette), la taille étant désormais bornée à l'insertion.Effet : logo net et jamais déformé, à empreinte identique à l'existant → aucun décalage de mise en page pour les logos déjà corrects.
Portée
Code partagé Saturne → s'applique à tous les documents ODT de tous les modules (DoliMeet, Digirisk, DigiQuali…). Changement volontairement minimal et iso-empreinte. Aucun asset
.minimpacté (PHP pur).Test
{mycompany_logo}).