Keeping Capture Image Names Unique

HelpXplain is the exciting new animated infographics and screencast tool that integrates with Help+Manual.

Moderators: Alexander Halser, Tim Green

Post Reply
User avatar
Olivier Beltrami
Posts: 379
Joined: Mon Jul 15, 2002 3:30 pm
Location: Nantes, France
Contact:

Keeping Capture Image Names Unique

Unread post by Olivier Beltrami » Fri Aug 13, 2021 3:37 pm

Hi,

I am having problems when I delete some slides, and then insert a screencast into a screencast, as HelpXplain will re-use some of the image names previously deleted (for example "capture6.png") for new slides.

On a local test machine this is Ok.

But on a web server, where images are often cached by the server itself, this causes problems as it takes a few days for the correct new screenshots to be displayed (and doing CTRL-F5 on the browser does nothing).

Would it be possible for each project to keep an autoinc value for the screenshots so that names are never re-used ?

Very best regards,

Olivier
Olivier Beltrami
https://www.qppstudio.net
Worldwide Public Holidays and Calendar Data

User avatar
Olivier Beltrami
Posts: 379
Joined: Mon Jul 15, 2002 3:30 pm
Location: Nantes, France
Contact:

Re: Keeping Capture Image Names Unique

Unread post by Olivier Beltrami » Sun Sep 05, 2021 10:41 am

Any thoughts on this ?
Olivier Beltrami
https://www.qppstudio.net
Worldwide Public Holidays and Calendar Data

User avatar
Alexander Halser
EC-Software Support
Posts: 4035
Joined: Mon Jun 24, 2002 7:24 pm
Location: Salzburg, Austria
Contact:

Re: Keeping Capture Image Names Unique

Unread post by Alexander Halser » Tue Sep 07, 2021 9:04 am

Hi Olivier,
We are working on this. I don't like the idea of internal counters, but we are going to find another solution.
Alexander Halser
Senior Software Architect, EC Software GmbH

User avatar
Olivier Beltrami
Posts: 379
Joined: Mon Jul 15, 2002 3:30 pm
Location: Nantes, France
Contact:

Re: Keeping Capture Image Names Unique

Unread post by Olivier Beltrami » Tue Sep 07, 2021 9:40 am

Thank you very much, Alexander.
Olivier Beltrami
https://www.qppstudio.net
Worldwide Public Holidays and Calendar Data

User avatar
Alexander Halser
EC-Software Support
Posts: 4035
Joined: Mon Jun 24, 2002 7:24 pm
Location: Salzburg, Austria
Contact:

Re: Keeping Capture Image Names Unique

Unread post by Alexander Halser » Wed Sep 08, 2021 3:19 pm

Hi Olivier,

The situation is far more tricky than it seems. If you make a new screencast, you will notice that every slide has a unique "capture" object, which represents an image. The capture names are unique and start with "capture1", "capture2" etc. However, if you look closely, you see that the actual images (the internal file names of the screen captures) are all named "capture1.png" throughout. The file names are not increasing and this is intentional.

In many screencasts, there are multiple slides containing the same background image. We want to re-use those images and not created multiple image files with the same content. That's why the images are all named "capture1.png". When you save (and reload) such an Xplain, you'll notice that the internal image names have changed (or have not changed, if they are identical). HelpXplain does a binary comparison of the image data before saving the Xplain. If there is a duplicate image name with a different image content, the image gets renamed automatically with a new number. This is done in the save procedure, because it takes too long to do it instantly.

It's a bit of a catch 22... If we deliberately assign new image file names, we get multiple images with the very same content, which is a bad idea, especially for longer screencasts. If we keep it the way it is, you've got cache problems. I don't see a real solution to this dilemma, except to clear the browser cache.
Alexander Halser
Senior Software Architect, EC Software GmbH

User avatar
Olivier Beltrami
Posts: 379
Joined: Mon Jul 15, 2002 3:30 pm
Location: Nantes, France
Contact:

Re: Keeping Capture Image Names Unique

Unread post by Olivier Beltrami » Wed Sep 08, 2021 4:38 pm

Hi Alexander,

Thank you very much for your detailed answer.

The problem is that refreshing the browser cache is not sufficient as most web servers will cache files at their end, using the .htaccess configuration file with settings for the mod_expires.c and mod_headers.c standard Linux/Apache modules.

In any case, refreshing the browser just refreshes the items on the current page, namely the .html file generated from the xplain project. But none of the PNG files are referred to in the page that hosts the xplain. This is probably why doing a CTRL-F5 does not solve the problem.

I thought that the problem was due to my lack of understanding of the HelpXplain, but are you saying that HelpXplain can at any time rename new images using an image name that was already posted online ?

That would mean that the only solution would be to remove PNG files from the types of files that the server caches. But then all the other PNG files on my server, which are non-changing will suddenly re-load on every visit.

Could HelpXplain perhaps save its images using a file extension that is not standard, such as .XPNG so that these images are not caught up in the usual server-side caching ?

Very best regards,

Olivier
Olivier Beltrami
https://www.qppstudio.net
Worldwide Public Holidays and Calendar Data

User avatar
Alexander Halser
EC-Software Support
Posts: 4035
Joined: Mon Jun 24, 2002 7:24 pm
Location: Salzburg, Austria
Contact:

Re: Keeping Capture Image Names Unique

Unread post by Alexander Halser » Wed Sep 08, 2021 5:16 pm

Could HelpXplain perhaps save its images using a file extension that is not standard, such as .XPNG so that these images are not caught up in the usual server-side caching ?
We could certainly do that but that creates a new server-side problem: your server won't recognize the file extensions and deliver images with an unknown MIME type in the HTTP header, most likely confusing the web browsers. Unless, of course, you tell your server to deliver them as PNGs with a correct MIME type. In that case, however, it is probably much simpler to add a different .htaccess file for the /xplain sub-folder that tells the server to not cache any images from there.
Alexander Halser
Senior Software Architect, EC Software GmbH

User avatar
Olivier Beltrami
Posts: 379
Joined: Mon Jul 15, 2002 3:30 pm
Location: Nantes, France
Contact:

Re: Keeping Capture Image Names Unique

Unread post by Olivier Beltrami » Wed Sep 08, 2021 5:46 pm

it is probably much simpler to add a different .htaccess file for the /xplain sub-folder that tells the server to not cache any images from there
Excellent idea.
I'll give it a try.
Thank you very much,

Olivier
Olivier Beltrami
https://www.qppstudio.net
Worldwide Public Holidays and Calendar Data

User avatar
Alexander Halser
EC-Software Support
Posts: 4035
Joined: Mon Jun 24, 2002 7:24 pm
Location: Salzburg, Austria
Contact:

Re: Keeping Capture Image Names Unique

Unread post by Alexander Halser » Wed Sep 08, 2021 6:09 pm

Excellent idea.
I'll give it a try.
I'd recommend to do this for existing Xplains. You can still cache them server-side, but set the expiration date relatively short.

Plus, we've changed the naming conventions in screencasts. After thinking it through, the possible re-use of images in a screencast is of limited value. Now, when inserting a screencast into an existing Xplain, the slide images get new numbers starting from the highest one (not reusing any deleted values) and the images on these slides pick up the name of the (unique) image object.

It is still possible to insert a regular picture from file and insert the same picture twice or more times in different slides. These images keep the original image file name and the actual images are re-used (if they are the same) and not exported twice.

Build 1450
https://www.helpandmanual.com/download/ ... p-v151.exe
Alexander Halser
Senior Software Architect, EC Software GmbH

User avatar
Olivier Beltrami
Posts: 379
Joined: Mon Jul 15, 2002 3:30 pm
Location: Nantes, France
Contact:

Re: Keeping Capture Image Names Unique

Unread post by Olivier Beltrami » Wed Sep 08, 2021 7:58 pm

Thank you very much, Alexander.
I'm downloading the update and will test it in the morning.
Very best regards,

Olivier
Olivier Beltrami
https://www.qppstudio.net
Worldwide Public Holidays and Calendar Data

Post Reply