sorry for the broken quotation, courtesy of gmail.. On Sat, Apr 16, 2016 at 9:46 PM, Rainer Mohr <[email protected]> wrote: > Hi Robert, Miika, > > Am 15.04.16 um 16:59 schrieb Robert Helling: > > Hi, > > On 15.04.2016, at 16:18, Miika Turkia <[email protected]> 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
This seems to work, just implemented that. (Really easy since Robert had all the required logic in place.) It might even suffice for us for off-line use if we cache the images as Robert says. However, it looked like we do not currently generate or save the hash. At least my single test ended up with .ssrf file with empty hashes for pics. What we are currently missing with this sort of import is the moment within the dive when the picture was taken. Subsurface format being the following: <picture filename='/home/mturkia/Pictures/P1090003.jpg' offset='+17:06 min' hash='e1ecd7adf24050fe05f23b4875f634d1dffeeee9'/> I guess we could try to run our image import function along with divelogs.de import when pictures are included to prepare the offsets. > 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... Yeah, I suspect the file size will be quite significant if one has a lot of pics within the log and imports them all. If we run into a limit, it should be easy enough for our users to upload selected dives only, as long as we are not talking about too small junks. miika _______________________________________________ subsurface mailing list [email protected] http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
