Bug 150317 - It is not possible to know which Calc sheet will be used as thumbnail in a document
Summary: It is not possible to know which Calc sheet will be used as thumbnail in a do...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.1.6.2 release
Hardware: All All
: medium normal
Assignee: Andreas Heinisch
URL:
Whiteboard: target:25.8.0
Keywords:
Depends on:
Blocks: Start-Center
  Show dependency treegraph
 
Reported: 2022-08-09 17:33 UTC by Fritz R. Paul
Modified: 2025-04-14 14:44 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Spreadsheet with pictures, page 2 used for the thumbnail (1.10 MB, application/vnd.oasis.opendocument.spreadsheet)
2022-08-17 09:35 UTC, Fritz R. Paul
Details
Spreadsheet with pictures, new sheet added as first sheet (1.18 MB, application/vnd.oasis.opendocument.spreadsheet)
2022-08-17 09:39 UTC, Fritz R. Paul
Details
Screenshot of Start Center with thumbnails (133.75 KB, image/png)
2022-08-18 11:57 UTC, Rafael Lima
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fritz R. Paul 2022-08-09 17:33:02 UTC
When saving a CALC file, an arbitrary part of an arbitrary sheet is taken as thumbnail image. This is extremely annoying for templates, which should be easy to identify. As a workaround, we now change the the thumbnail.png image in the zipped ots file after modifying the template.
At a minimum it should be deterministic, which area is taken for the thumbnail. But to make the thumbnails useful, there should be an easy way to set a predefined image as thumbnail or to at least an option to keep the current thumbnail picture.
Comment 1 Rafael Lima 2022-08-15 22:39:41 UTC
Hi Fritz,

Could you please share a sample file for testing?
Comment 2 Fritz R. Paul 2022-08-17 09:35:14 UTC
Created attachment 181827 [details]
Spreadsheet with pictures, page 2 used for the thumbnail

Here, the sheet (2) with the latest picture added is used. This is working sometimes, but not always.
Comment 3 Fritz R. Paul 2022-08-17 09:39:29 UTC
Created attachment 181828 [details]
Spreadsheet with pictures, new sheet added as first sheet

Now the new first sheet is used to generate the thumbnail. But it is neither always the case, that the latest edit determines the page used, nor is is clear, which part of a page is used for the thumbnail.
Comment 4 QA Administrators 2022-08-18 03:41:50 UTC Comment hidden (obsolete)
Comment 5 Rafael Lima 2022-08-18 11:57:16 UTC
Created attachment 181850 [details]
Screenshot of Start Center with thumbnails

(In reply to Fritz R. Paul from comment #2)
> Created attachment 181827 [details]
> Here, the sheet (2) with the latest picture added is used. This is working
> sometimes, but not always.

For me Slide 1 was used as thumbnail here after I opened the file (did not edit anything nor saved anything)


(In reply to Fritz R. Paul from comment #3)
> Created attachment 181828 [details]
> Now the new first sheet is used to generate the thumbnail. But it is neither
> always the case, that the latest edit determines the page used, nor is is
> clear, which part of a page is used for the thumbnail.

Here LO used slide 3 as the thumbnail. See attached image with the screenshot of my start center.

Indeed this seems a bit unstable and unpredictable from the user's perspective.
Comment 6 Rafael Lima 2022-08-18 12:07:37 UTC
I could not find any official documentation about thumbnail generation, but it seems that the last save determines the thumbnail.

https://ask.libreoffice.org/t/calc-desktop-icon-displays-a-miniature-version-of-one-of-the-sheets-in-the-document/60459/3

Need to look into this a bit further.
Comment 7 Rafael Lima 2022-08-18 12:25:32 UTC
I came up with reproducible steps so that Sheet 2 ends up being the thumbnail for no apparent reason:

1) Create a new Calc document with 2 sheets
2) Edit Sheet 1
3) Now edit Sheet 2
4) Save and close the document
5) Go to the start center and notice the thumbnail; It'll use Sheet 1 as the thumbnail
6) Now open the file from the start center
7) Edit Sheet 2 and save; Close the document
8) Go to the start center and notice the thumbnail; It'll use Sheet 2 now as the thumbnail (why??)

In the first version of the document Sheet 1 was used after editing and saving Sheet 2. Then in the second attempt I edited Sheet 2 and now Sheet 2 becomes the  thumbnail. I do not see a logic in this.

I'm setting this to NEW because improvements can be made.
Comment 8 Andreas Heinisch 2025-03-09 16:59:46 UTC
Imho it solves this problem: https://gerrit.libreoffice.org/c/core/+/182698

However, if you don't save the document, the thumbnail in the start center wan't be updated. Don't know if the thumbnail should always show the current active sheet or if it is enough after saving the current document?
Comment 9 Commit Notification 2025-03-10 08:14:42 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/c94fa3d5b2225e46eb5d90a090e0586cbc7464ba

tdf#150317 - Sync visible tab during save process

It will be available in 25.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Andreas Heinisch 2025-03-10 08:17:52 UTC
Feel free to open this again, when we should rather switch to the current active sheet.
Comment 11 Fritz R. Paul 2025-03-11 08:39:06 UTC
Hi Andreas,

while this is an improvement, it is not as useful as it could be. The thumbnail pictures are a nice way to identify templates when opening new documents from templates. This works best, if a predefined icon/picture can be used for this purpose. This is what we do in the company. Setting it once is not a big deal (although it would be nice to habe an option when storing a template). But in any case it would be helpful to not overwrite the picture when storing the template again. So why not leave the thumbnail picture unchanged when there is one already?
Comment 12 Andreas Heinisch 2025-03-11 09:04:44 UTC
This would be a nice enhancement. Not generating a thumbnail during the save process could be dangerous since a file could be changed substantially with no new thumbnail. 

This could be wanted since you set a thumbnail. For the average user this could be cause missunderstandings.

May you file a new bug report with this request, where we could set such a thumbnail? For instance, where do you set your thumbnail for your company?
Comment 13 Fritz R. Paul 2025-03-14 09:22:56 UTC
I understand the problem. Here, we open the otx archives and exchange the thumbnail picture directly, before we publish the modified template. This is an additional manual interaction, which we would like to get rid of. Solving that should of course not generate additional complexity for users that don't need this feature (although I would assume it would be useful for most cases, where templates are shared).

You are right, this should become a new feature request and this bug can be closed.
Comment 14 Andreas Heinisch 2025-03-14 10:53:55 UTC
Thank you very much!
Comment 15 Buovjaga 2025-04-10 07:58:23 UTC
(In reply to Fritz R. Paul from comment #13)
> I understand the problem. Here, we open the otx archives and exchange the
> thumbnail picture directly, before we publish the modified template. This is
> an additional manual interaction, which we would like to get rid of. Solving
> that should of course not generate additional complexity for users that
> don't need this feature (although I would assume it would be useful for most
> cases, where templates are shared).
> 
> You are right, this should become a new feature request and this bug can be
> closed.

This sounds so specialised that it seems an extension would be the best solution.
Comment 16 Fritz R. Paul 2025-04-10 10:37:30 UTC
(In reply to Buovjaga from comment #15)
> (In reply to Fritz R. Paul from comment #13)
> > I understand the problem. Here, we open the otx archives and exchange the
> > thumbnail picture directly, before we publish the modified template. This is
> > an additional manual interaction, which we would like to get rid of. Solving
> > that should of course not generate additional complexity for users that
> > don't need this feature (although I would assume it would be useful for most
> > cases, where templates are shared).
> > 
> > You are right, this should become a new feature request and this bug can be
> > closed.
> 
> This sounds so specialised that it seems an extension would be the best
> solution.

I have problems to see, how this could work as an extension. It would have to hook into a trigger when closing a changed document, which is called after the normal thumbnail creation. We would also need a way for an extension to modify the thumbnail (access to the internal structure).
Comment 17 Eyal Rozenberg 2025-04-14 14:34:35 UTC
So, what is the thumbnail choice logic with this fix integrated?
Comment 18 Andreas Heinisch 2025-04-14 14:44:51 UTC
The last shown sheet will be used as a thumbnail.