Adding support for mso attribute 'thresh' in black/white images

Xisco Fauli xiscofauli at libreoffice.org
Thu Oct 3 08:08:18 UTC 2019


Hello,

the OOXML format has the attribute 'thresh' in <a:biLevel> element for
specifying the threshold value for luminance in black/white effect for
images.

Right now, LibreOffice just ignores this attribute as the threshold is
hardcoded to 50% here
https://opengrok.libreoffice.org/xref/core/vcl/source/gdi/bitmap3.cxx?r=f93a345a#253

However, MSO allows the users to change the threshold to 25% or 75%, so
when LibreOffice imports those images, they have a 50% threshold and it
causes https://bugs.documentfoundation.org/show_bug.cgi?id=105380

My question is, once the value is parsed in
https://opengrok.libreoffice.org/xref/core/oox/source/drawingml/fillproperties.cxx?r=09cd0e36#750,
what would be the best way to have it in vcl ? should I just do the same
we do with luminance or contrast and have a property called
'AdjustThreshold' or is there any other easier way to do it? I'm asking
because luminance and contrast are used throughout the code and this
solution seems like using a sledgehammer to crack a nut as the threshold
value won't be used anywhere else.

Regards

-- 
Xisco FaulĂ­
Libreoffice QA Team
IRC: x1sc0

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice/attachments/20191003/403277cf/attachment.html>


More information about the LibreOffice mailing list