Issue 121445

Summary: Allow ThumbNails to have Alpha and use common tiling background in gray and white
Product: Draw Reporter: Armin Le Grand <Armin.Le.Grand>
Component: uiAssignee: Armin Le Grand <Armin.Le.Grand>
Status: CLOSED FIXED QA Contact:
Severity: Normal    
Priority: P3 CC: issues
Version: 4.0.0-dev   
Target Milestone: 4.0.0   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---

Description Armin Le Grand 2012-12-07 10:12:41 UTC
ALG: This is a follow-up to #121407# and will try to use transparent thumbnails for the gallery in a compatible way. Also add the from all graphic pixel apps well known tiled background in that cases (grey/white)

ALG: First thought about adding this fixed to the thumbnail, but that leads to problems when it's smaller than the standard size and also expands the file size unneccessarily. Checking now if it's possible to use BitmapEx; hard thing will be the file format and if it's possible to do it compatible.
Comment 1 Armin Le Grand 2012-12-07 10:14:30 UTC
ALG: Taking over.
Comment 2 Armin Le Grand 2012-12-07 10:18:42 UTC
ALG: Checked the Bitmap/BitmapEx streaming code (used binary in thumbnail files for gallery) and it should work (it uses magic numbers after the regular Bitmap is written). Trying this...
Comment 3 Armin Le Grand 2012-12-07 13:53:32 UTC
ALG: Had to do deep adaptions in gallery implementation and usages to use BitmapEx instead of Bitmap. Adapted gallery paints for list and normal form to use checkered background for transparent objects. Made sure that bitmap formats (gif and png) are added correctly. Made sure that draw objects are added correctly, needed some rewrite there. Checked for metafiles, too (svm). Also checked for emf and wmf as graphic file formats.
Some more checks...
Comment 4 Armin Le Grand 2012-12-07 14:44:26 UTC
ALG: Okay, works well. Re-coding gallery themes to reflect changes...
Comment 5 Armin Le Grand 2012-12-07 15:45:45 UTC
ALG: STumbled over the gallery theme 36, called private://gallery/hidden/fontwork, it is a hidden one used for the fontwork dialog. It has thumbs, but no real gallery data. It only uses the thumbs for the dialog. To make it use the transparence I would need to recreate it. I will try to find out how to do that...
There is also theme 24, hidden, called private://gallery/hidden/imgppt. May be used at ppt data exchange, lets see...
Comment 6 Armin Le Grand 2012-12-07 15:54:52 UTC
ALG: Theme private://gallery/hidden/fontwork has ID 37 (for ressources) and bThemeNameFromResource is true. private://gallery/hidden/imgppt has ID 16 and also true. I do not yet know if it is used somewhere...
Comment 7 Armin Le Grand 2012-12-07 18:02:39 UTC
ALG: Got the private://gallery/hidden/fontwork reworked, looking for adding the checkered background now...
Comment 8 Armin Le Grand 2012-12-07 18:06:53 UTC
ALG: Checked for RID_GALLERYSTR_THEME_POWERPOINT because of private://gallery/hidden/imgppt, but there is only a string defined in src and the ID, so there should be no usage anymore.
Comment 9 Armin Le Grand 2012-12-07 18:12:23 UTC
ALG: Corrected aspect ratio when creating draw drops to the gallery to have the correct visualisation.
Also moved the checkered painter to OutputDevice directly; it may be optimized there and is useful in two places already.

Works as expected. For all gallery entries you can now see instantly if an when what transparent parts a graphic contains.
Preparing commit...
Comment 10 SVN Robot 2012-12-07 18:15:19 UTC
"alg" committed SVN revision 1418421 into trunk:
#121445# Added transparency support to the gallery
Comment 11 Armin Le Grand 2012-12-07 18:16:12 UTC
ALG: Okay, done. This one was harder than I thought, but one more step to full transparency support in AOO.
Comment 12 Armin Le Grand 2012-12-10 13:35:53 UTC
ALG: Thanks to Sven Jacobi, he found an old mail entry which I copy to this task to have it documented here (Link is http://markmail.org/thread/xpvmgjcqngyqllom), just don't know how olng it will stay there:


-----snip-----
Hello,

you can set following environment variables before starting the Office, then you will also see private Gallery themes that are used for CustomShapes or FontWork.

GALLERY_SHOW_PRIVATE_TITLE GALLERY_ENABLE_ID_DIALOG GALLERY_SHOW_HIDDEN_THEMES AVOID_BURN_IN_FOR_GALLERY_THEME

(The last environment variable is important to avoid that soft formatting attributes from style or template are stored as hard attribute to the shape).

Changing a shape can now simply be done by replacing/adding the corresponding shape within the private gallery theme.

private://gallery/hidden/imgppt is used for CustomShapes private://gallery/hidden/fontwork is used for FontWork

Within the gallery you only have to set the correct title for the shape as it is used within the following xml configuration files:

customshapes: share/config/soffice.cfg/modules/sglobal/toolbar/arrowshapes.xml share/config/soffice.cfg/modules/sglobal/toolbar/basicshapes.xml share/config/soffice.cfg/modules/sglobal/toolbar/calloutshapes.xml share/config/soffice.cfg/modules/sglobal/toolbar/flowchartshapes.xml share/config/soffice.cfg/modules/sglobal/toolbar/symbolshapes.xml share/config/soffice.cfg/modules/sglobal/toolbar/starshapes.xml

fontwork types: share/config/soffice.cfg/modules/sglobal/toolbar/fontworkshapetype.xml

I hope this helps you to update your Gallery.

If you are having further problems, then please let's follow up on the de...@graphics.openoffice.org mailing list.

Best regards Sven