Changing Image Size does not Update the Modification Date

Please post all questions and comments regarding Help & Manual 7 here.

Moderators: Alexander Halser, Tim Green

Post Reply
Sean Godley
Posts: 92
Joined: Sun Apr 24, 2016 6:10 am

Changing Image Size does not Update the Modification Date

Unread post by Sean Godley »

Hi all,

I recently updated the size of all images in my documentation, and saved them with their original names. To my surprise, when the time came to commit these changes to the SVN at work, the changes were not recognised by the SVN. After some digging, it seems that this is because changing only the size of images does not update the Modification timestamp, which results in the SVN not recognising that there are any changes in the file. Is this an issue that you have seen before, and do you know a method that can be used to resolve it?

Many thanks,

Sean
User avatar
Tim Green
Site Admin
Posts: 23155
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Changing Image Size does not Update the Modification Date

Unread post by Tim Green »

Hi Sean,

This behavior is correct. Changing the image size in the Help+Manual editor does not make any changes to the image files. It just changes the reference to the image that tells Help+Manual how to process it when you publish. The original files are never touched or modified in any way, even when you publish. If it resized the image on the disk every time you changed the size setting in the Help+Manual editor the results would be disastrous. Try doing that in a graphics editor: Resize an image to 10% of its original size, save it, and then resize it by 10x to restore it to its "original" size... 8)
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Sean Godley
Posts: 92
Joined: Sun Apr 24, 2016 6:10 am

Re: Changing Image Size does not Update the Modification Date

Unread post by Sean Godley »

Hi Tim, thanks for the quick reply.

Perhaps I should have explained more clearly - I did update the size of the original files (in Photoshop) and saved them to disk on my machine. In actual fact, they are completely new images, but they were saved with the same name as the existing file that they replaced (in order to avoid having to delete the existing file manually/end up with a lot of unused images in the manual images folder). When I publish locally the manual looks as it should and all the images are updated to the new versions. However, when I commit to the SVN, the SVN does not recognise any changes in the image files (I believe because updating only the size/content and not the name of an image does not result in a new 'Modified' Timestamp in the image properties) and therefore continues to use the old images when publishing. It is not possible to delete the old images from the SVN and I am currently searching for a quick way to create an updated 'Modified' timestamp for the thousands of images in the image folders for my manuals - but it does not seem like there is a simple, straightforward way to do this. Does that make more sense?

Thanks for the help,

Sean
User avatar
Tim Green
Site Admin
Posts: 23155
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Changing Image Size does not Update the Modification Date

Unread post by Tim Green »

Hi Sean,

If you change the image size SVN will always notice and update the file. If there is ANY change in the file it will always get noticed by SVN, even if just a single bit in a single byte is changed. I just double-checked it and it always worked.

On possibility is that your image files are not stored in the same folder as your Help+Manual project. If that is the case then Help+Manual will not automatically include your images in the SVN update as its SVN support only monitors files inside the project folder. If your images are outside the project folder but included in your SVN project you will need to commit them manually with Tortoise and not with Help+Manual. (By the way: If you want to move the images into the project folder don't do it manually with Windows File Explorer. Changes in SVN-managed files like that should always be made with Tortoise. Either that or make a copy outside of the SVN folder completely and then make a new repository from that.)

Otherwise, it definitely has nothing to do with Help+Manual. Either those files are not being monitored by SVN at all, or there is something not working correctly in your SVN configuration/installation. :?
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Sean Godley
Posts: 92
Joined: Sun Apr 24, 2016 6:10 am

Re: Changing Image Size does not Update the Modification Date

Unread post by Sean Godley »

Hi again Tim,

I believe the problem is that I am publishing to Webhelp format, which as I'm sure you know involves publishing .html files. These are the problematic files that the SVN is not recognising as having been updated, because although the images within them have changed/been resized, their 'Modified' timestamp is not changed as a result of these changes, and it is this property (I believe) that the SVN uses to recognise that the file has been updated. This means that when I go to commit, the SVN of course does not see any changes in these .html files, and therefore continues to use the old .html files in the SVN. In cases where the name of the image is also updated, the SVN does indeed recognise the changes in the .html files (presumably because changing the name of the image also updates the 'Modified' timestamp in the .html file) and updates accordingly.

I also publish the same manuals to PDF format, and there are no issues with the same images above being updated within the output PDF file (presumably because the output content is a single file, and thus even a single change to the text or anything else results in an updated 'Modified' timestamp).

Would be great to get your thoughts on this.

Cheers,

Sean
User avatar
Tim Green
Site Admin
Posts: 23155
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Changing Image Size does not Update the Modification Date

Unread post by Tim Green »

Sean,

Why are you including your WebHelp output in your SVN storage? That is completely unnecessary and just a waste of time and storage space. You should only ever maintain your source files in SVN, not the output. Also, are you using anything in the output folder as source for your project? If you are that creates a fatal circular references. The output folder should also never be inside your project folder.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
Tim Green
Site Admin
Posts: 23155
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Changing Image Size does not Update the Modification Date

Unread post by Tim Green »

Sean,
These are the problematic files that the SVN is not recognising as having been updated, because although the images within them have changed/been resized, their 'Modified' timestamp is not changed as a result of these changes, and it is this property (I believe) that the SVN uses to recognise that the file has been updated.
SVN does not just use timestamps. It does a checksum of the entire contents of the file. No matter what changes, SVN will find it, even if it is just a single bit in a single byte. If the HTML files are not being registered by SVN as changed that means that they have NOT changed. That also makes sense if you are only changing the images. The topic files don't change when you do that.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
michal_novomesky
Posts: 51
Joined: Thu Jan 12, 2012 2:21 pm
Contact:

Re: Changing Image Size does not Update the Modification Date

Unread post by michal_novomesky »

Same problem here with SVN.
As well with .css files, and with old timestamp, the browser do not recognize updates to files modified in the past in the skin.

Our workaround is to update timestamp manually after HTML compilation using a .bat file.

If I can suggest an improvement, add a switch to HTML compilation saying to not override timestamps :)
User avatar
Tim Green
Site Admin
Posts: 23155
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Changing Image Size does not Update the Modification Date

Unread post by Tim Green »

michal_novomesky wrote: Mon Nov 08, 2021 9:19 am As well with .css files, and with old timestamp, the browser do not recognize updates to files modified in the past in the skin.
Which browser, where? SVN is not timestamp-based, it is content-based. It will also flag timestamp changes, but that is very secondary. Also, it sounds as though you are managing your WebHelp output in SVN. If that is the case, why? You only need to manage your source projects. The WebHelp output is ephemeral and does not need to be managed like that at all.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
michal_novomesky
Posts: 51
Joined: Thu Jan 12, 2012 2:21 pm
Contact:

Re: Changing Image Size does not Update the Modification Date

Unread post by michal_novomesky »

SVN is not timestamp-based, it is content-based.
Tim, as usual, You will not believe until you will see it. It's a problem in Windows-based SVN implementations like TortoiseSVN. Sometimes, if a changed file contain only one minor change in one row (or changes in indentation), SVN does not see it. If I update timestamp for any .css or .html file, SVN will see the changes.
Which browser, where?
It's not browser-dependent. If you "curl" the affected CSS file, the layout.css file timestamp of the file stays the same in HTML output as the last modification date of layout.css in .hmskin. In this case, if you are a returning visitor, a browser might not reload CSS definitions as layout.css seems "unchanged".

Code: Select all

C:\>curl --head "https://URL/project/css/layout.css"
HTTP/1.1 200 OK
Server: nginx
Date: Mon, 02 Aug 2021 14:30:20 GMT
A workaround (but not very ideal) solution is to override .css file timestamps after HTML commandline complation using .bat like this:

Code: Select all

FOR %%f IN (%EXPORTPATH%\css\*.css) DO (
    COPY /b %%f +,, %%f >nul
)
It sounds as though you are managing your WebHelp output in SVN. If that is the case, why?
Because we have multiple front-end servers (load-balanced). On each front-end server, "svn update" is triggered each 30 minutes. And, we want to see what has been changed/SVN-commited to production. Of course there is room for improvement, like to commit H&M source files with xml configs to any revisioning software (GIT/SVN,...) and have a backend system to auto-generate HTML outputs. Each solution has its pros/cons and gains/pains.
User avatar
Tim Green
Site Admin
Posts: 23155
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Changing Image Size does not Update the Modification Date

Unread post by Tim Green »

Hi Michal,

OK, although I've never seen SVN not see a change in a file. But assuming that it does happen, I need to know specifically which files you need to have timestamps set for, and under what circumstances. Otherwise our developers won't know what they need to change.

Also: I notice now you're posting this in the Help+Manual 7 forum. It's important to know that HM7 is no longer under development, so any changes would only be implemented in version 8. :?
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
michal_novomesky
Posts: 51
Joined: Thu Jan 12, 2012 2:21 pm
Contact:

Re: Changing Image Size does not Update the Modification Date

Unread post by michal_novomesky »

I know.
I just wanted to follow-up discussion which I find during forum search to extend the knowledge for others.

As of now, nothing is needed. If you continue receiving more requests about file timestamps, you'll implement the switch to HTML compilation.
Post Reply