I've implemented hard links for jAlbum 14.2 beta now. Get it from
http://jalbum.net/download/beta/jalbum-core.jar and put the attached "texts.properties" in jAlbum's "texts" folder to test it.
When switched on, hard links applies to the original and resource files written to the album folder. The default setting is off. You can activate it under Preferences->Album.
As hard links are implemented at a very low level in the file system, checking the album folder size doesn't reveal any change, but you should be able to notice that the free space reported for the disk volume used is affected by hard links. I saw a massive impact: For my sample album of 89 images, the disk usage went down from 400MB to 10MB - i.e. 2.5% of the earlier size. Here's the data when monitoring disk usage after making album with hard links off and on:
Before 229,35 GB free
After making ordinary album: 228,95 GB free. Album size: 400MB
After making hard linked album: 229,34 GB free. Album size: 10 MB
Effective compression: 2.5% of original size
You have to issue a "Make all" in order to have the files re-generated.
Warning: There is a potential for data loss: If you make an album with hard links to originals and then make the same album in an older version of jAlbum (a make all operation), then your originals will be truncated to 0 bytes length, and I'm talking about your
real originals, not the hard-linked copies
. The reason for this is that, when instructed to copy an original file to the album folder, it effectively uses the same file for the source and destination without knowing it. This causes the source file to be truncated as soon as the destination is opened for writing. jAlbum 14.2 prevents this from happening by deleting the destination file before writing to it as it makes a copy, thereby breaking the hard link, but this delete instruction is naturally not present in earlier jAlbum versions.
To conclude: Hard links gives a massive improvement in lowered disk usage but comes with a potential for data loss if you move back and forth between jAlbum versions. The impact is luckily limited by jAlbum's default behavior to
copy files to the album project and not link to them.
Sidenote: jAlbum 14.2 has further preparation for Java 9. This unfortunately causes it to consider album projects changed so the first time you move to jAlbum 14.2 it will want to reprocess your images, but after that, it should be as clever as before to determine if images needs to be reprocessed or not. Moving on from now, it's less likely that we will see this unnecessary reprocessing happening again.