DLD Changes

Rainer Mohr mail at divelogs.de
Sat Apr 16 11:46:00 PDT 2016


Hi Robert, Miika,

Am 15.04.16 um 16:59 schrieb Robert Helling:
> Hi,
>
>> On 15.04.2016, at 16:18, Miika Turkia <miika.turkia at gmail.com 
>> <mailto:miika.turkia at gmail.com>> wrote:
>>
>> (Not that I would have a clear
>> picture on what Robert has done on Subsurface end regarding picture
>> management in-between :D)
>
> not much actually. But (and I guess that was also the case the last 
> time we spoke about this) in subsurface, images can be URLs. That is a 
> picture has this thing that is called “filename”, but that can be more 
> general. First we try to interpret that as a local filename and see if 
> that loads as a picture. If it doesn’t, we interpret is as a URL and 
> download it (upon displaying the dive) from the interwebs. Once 
> successfully downloaded, we cache that picture and (based on its hash 
> value)  access the local version. So if Rainer provided us just with a 
> valid image URL the rest would automagically work from there.

Well, there is a tag in the DLDs XML data for the pictures and its 
already fully functional.....
Here's an example for my last dives pictures:

<PICTURES>
     <PICTURE lastModified="2016-03-18 16:07:33" 
path="/pictures/rainer/">1683296-1.jpg</PICTURE>
     <PICTURE lastModified="2016-03-18 16:07:33" 
path="/pictures/rainer/">1683296-2.jpg</PICTURE>
     <PICTURE lastModified="2016-03-18 16:07:34" 
path="/pictures/rainer/">1683296-3.jpg</PICTURE>
     <PICTURE lastModified="2016-03-18 16:07:34" 
path="/pictures/rainer/">1683296-4.jpg</PICTURE>
     <PICTURE lastModified="2016-03-18 16:07:34" 
path="/pictures/rainer/">1683296-5.jpg</PICTURE>
     <PICTURE lastModified="2016-03-18 16:07:34" 
path="/pictures/rainer/">1683296-6.jpg</PICTURE>
   </PICTURES>

so if you simply concatenate "https://divelogs.de", the path attribute 
and the value of the <PICTURE> Tag, you have your URL already:

https://divelogs.de/pictures/rainer/1683296-1.jpg

>
> If you further wanted to preserve bad with, the server could already 
> compute the SHA1 hash of the image file. In that case we wouldn’t even 
> load it if we had a local copy with a different “Filename”.
>
> Upload, of course is a different matter.

This is already sort of "prepared" on the server side but not yet released.
My idea was to include a folder "pictures" in the DLD file and stuff all 
the pics in there. Add the <PICTURES> tag in the XML and that would be 
just about it for a start. Biggest problem is probably that the DLD 
files could get damn big and exceed the servers POST limit quite soon. 
But I guess we could experiment...

Rainer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20160416/1720462f/attachment.html>


More information about the subsurface mailing list