Hashes for images

Robert Helling helling at lmu.de
Mon Feb 23 06:51:42 PST 2015


Hi,

here is a series of patches that should make our handling of images less computer dependent.



Upon successfully loading an image, we also compute a SHA1-hash of the image file and store it with he (“original”) filename. In addition we build up dictionaries between hashes and filenames that are read from disk upon startup and saved in the destructor of the main window (BTW: I found the AppData Path on my mac not writeable per default maybe that needs looking into).

When reading an image file from disk fails, we check the dictionary if the dictionary knows about a different path for the file with the appropriate hash and we display that instead. But to the user we always show the “original” file name.

In addition, there is a new entry to the file menu “hash images”. With that the user can point subsurface to a directory that is scanned recursively (in the background without any visual feedback besides possibly appearing images) for image files of which the hash is computed and stored in the dictionary.

So, when moving the divelog form one computer to the other, the user only has to bulk transfer all images and tell subsurface about the location of those and it will figure out the details itself.

Alternatively, the user can keep her files in a cloud synched directory and tell subsurface about it even when the patch to that directory differs on different machines.

Best
Robert

PS: 2677f3ca breaks the build for me. What am I supposed to do about it besides reverting it?

--
.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oO
Robert C. Helling     Elite Master Course Theoretical and Mathematical Physics
                      Scientific Coordinator
                      Ludwig Maximilians Universitaet Muenchen, Dept. Physik
                      Phone: +49 89 2180-4523  Theresienstr. 39, rm. B339
                      http://www.atdotde.de

Enhance your privacy, use cryptography! My PGP keys have fingerprints
A9D1 A01D 13A5 31FA 6515  BB44 0820 367C 36BC 0C1D    and
DCED 37B6 251C 7861 270D  5613 95C7 9D32 9A8D 9B8F





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150223/3d954e80/attachment-0005.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-Add-hashes-to-pictures.txt
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150223/3d954e80/attachment-0004.txt>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150223/3d954e80/attachment-0006.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0002-Save-and-use-database-of-image-hashes.txt
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150223/3d954e80/attachment-0005.txt>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150223/3d954e80/attachment-0007.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0003-Make-double-click-on-picture-open-the-correct-local-fi.txt
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150223/3d954e80/attachment-0006.txt>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150223/3d954e80/attachment-0008.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0004-Add-UI-for-update-image-hash.txt
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150223/3d954e80/attachment-0007.txt>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150223/3d954e80/attachment-0009.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 203 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150223/3d954e80/attachment-0001.sig>


More information about the subsurface mailing list