Bug 117330 - Images in gallery look poor when they are small
Summary: Images in gallery look poor when they are small
Status: RESOLVED DUPLICATE of bug 81593
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
6.0.4.1 rc
Hardware: All All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-29 09:49 UTC by sergio.callegari
Modified: 2018-06-21 08:08 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot (13.77 KB, image/png)
2018-06-04 15:21 UTC, sergio.callegari
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sergio.callegari 2018-04-29 09:49:24 UTC
Description:
When a vector drawing is put in the gallery, recent versions of LibO (I think since LibO 4.x or 5.x) create a bitmap to show in the gallery, that also details if the object has a solid background or not.

Unfortunately, this preview bitmap is taken at a fixed resolution ignoring the drawing size. This is not the best thing to do as it results in wasted resources when the image is big and in a poor rendering in the gallery when the image is small.

Consider the following example:

1) A 10 inch X 10 inch vector object (e.g., a whole drawing) is placed in the gallery. Assuming that the preview bitmap is taken at 100dpi (I do not know the exact resolution being used), a 1000x1000 pixel bitmap is used for the preview. When the preview appears in the gallery, given that the object will likely be offered a 0.5x0.5 inch space, the preview will have a quite redundant 2000 dpi effective resolution.

2) A small vectory symbol 0.25 x 0.25 inches is placed in the gallery. Assuming that the preview bitmap is taken at 100dpi (I do not know the exact resolution being used), a 25x25 pixel bitmap is used for the preview. When the preview appears in the gallery, given that the object will likely be offered a 0.5x0.5 inch space, the preview will have a poor 50 dpi effective resolution.

Imho, the preview bitmap in the gallery should be created with a fixed number of pixels on the x and y axis (e.g. 256), so that it always shows well when the gallery is opened.
means that when the bitmap is shown in gallery, being given a fixed size, it is shown at different resolutions, 

Steps to Reproduce:
See description

Actual Results:  
See description

Expected Results:
See description


Reproducible: Always


User Profile Reset: No



Additional Info:
[Information automatically included from LibreOffice]
Locale: en-US
Module: DrawingDocument
[Information guessed from browser]
OS: Linux (All)
OS is 64bit: yes


User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0
Comment 1 Xisco Faulí 2018-06-04 09:42:20 UTC
Hello Sergio,
Could you please attach an image to reproduce this problem? It would be nice to have a screenshot showing how it looks as well...
Comment 2 sergio.callegari 2018-06-04 15:21:39 UTC
Created attachment 142520 [details]
Screenshot

In the screenshot, there are 12 images stored in the gallery (electronic symbols). They are about 1.5 cm wide when imported in a drawing/presentation.

From left to right, top to bottom:

- images 1, 2, 5, 6, 10, 11, 12 were made with ancient versions of LibO. This is evident from the fact that the gallery thumbnail does not include the pattern for transparent background.

- other images are made with modern LibO.

Notice how in all images the resolution is too low. In fact, it is particularly bad for images 3, 4, 7, 8, 9 where the thumbnails are obtained by modern LibO. Vertical lines at the top, bottom of the MOS transistor symbol are almost invisible (look light gray) because of antialiasing.
Comment 3 Buovjaga 2018-06-20 18:44:45 UTC

*** This bug has been marked as a duplicate of bug 81593 ***
Comment 4 sergio.callegari 2018-06-21 08:04:06 UTC
Note that the issue is not specific to svg files as in bug 81593. In my test case, the images are actually drawings made with LibO itself. The issue is actually related to the "pixel size" of the images and appears with any type of vector image.
Comment 5 Buovjaga 2018-06-21 08:08:59 UTC
(In reply to sergio.callegari from comment #4)
> Note that the issue is not specific to svg files as in bug 81593. In my test
> case, the images are actually drawings made with LibO itself. The issue is
> actually related to the "pixel size" of the images and appears with any type
> of vector image.

Sure, I can change bug 81593