![]() |
|
Slow to add album thumbnail with CR2 - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: General support (https://forum.zenphoto.org/forum-4.html) +--- Thread: Slow to add album thumbnail with CR2 (/thread-10345.html) |
Slow to add album thumbnail with CR2 - steve.zenphoto - 2012-08-30 I have a lot of canon raw (CR2) photos. They live on an nfs attached NAS device. When page through my albums, the first time takes a long time - 30 minutes is not unusual. I have selected the option to use the 1st alphabetical entry in albums for the thumb. Having a look at the code it seems that it do the cr2->png conversion for the thumb on every picture in the album before it decides it only wants the first one. This is done be the call to getImages in getAlbumThumbImage. Also it doesn't seem to cache the results, so visiting the album causes the thumbnails to be generated again. Slow to add album thumbnail with CR2 - sbillard - 2012-08-30 What are you using for support for CR2 files? Not something that Zenphoto does native. Slow to add album thumbnail with CR2 - steve.zenphoto - 2012-08-30 Imagemagick - i thought that was supported by zenphoto Slow to add album thumbnail with CR2 - sbillard - 2012-08-30 Lib_imagick is supported. I do not have Imagemagic and was not aware it provided support for raw files. I am not sure I understand what you are saying, though.
Slow to add album thumbnail with CR2 - steve.zenphoto - 2012-08-31 I've added a few debugLogs to see where the time goes. In getAlbumThumbImage it calls getImages. This calls newImage which in turn calls "New _Image" this calls: parent:ersistentObject. This call takes 15-30s typically for a CR2. Slow to add album thumbnail with CR2 - sbillard - 2012-08-31 Zenphoto does not directly use the /tmp folder, but perhaps something downstream does. We look forward to your analysis. It might be interesting to see what the same results are for You should not be in the Slow to add album thumbnail with CR2 - steve.zenphoto - 2012-08-31 I imagine is it imagemagick that is using /tmp. Clearly it is the meta processing. I've basically uploaded a large number of directories and files. The qn is why does it do it when all it needs to do is get a list of files - which is what you implied above. As I said above when it's finished the only thumbnail it retains is the one it has chosen to represent the album. So when one visits the album for the first time one still has to create the thumbnails for all the pictures in the album. Slow to add album thumbnail with CR2 - sbillard - 2012-08-31 It instantiates the image to be able to test the "kind" of image. For instance, if it were a video it would not be used for a thumbnail unless it has an alternate thumb image. But the metadata processing should happen only one time. Once the image is logged into the database it is no longer "new" unless its filemtime changes. Also the loop terminates when a suitable thumbnail is discovered. Retaining the thumbnail image in the cache is quite different from selecting an image to be the thumbnail. Slow to add album thumbnail with CR2 - sbillard - 2012-08-31 I have looked at the Slow to add album thumbnail with CR2 - steve.zenphoto - 2012-09-01 Does it need the IPTC data at that point? Can you make it "lazy" - that is don't read it till you need it? The 'problem' - well I think it's a problem - seems to come from the call to getImages(0,0...) that according to the documentation will mean it will read every file in the directory and doing the IPTC thing. As I don't really care what picture it defaults to I changed it to getImages(1,1...) which I think will mean it will only return one. This should make the whole thing workable. That is not a good general solution though. A good solution might be to pass a max count to getImages. Slow to add album thumbnail with CR2 - sbillard - 2012-09-01 I will repeat again: Only "New" images will have their metadata processed. New is defined as not seen before by Zenphoto or having their timestamp changed from when Zenphoto saw them. The database needs to be populated with all the image data when the image is discovered. Otherwise there is no reasonable point in time that could be used to do that. But since this is a one-time occurance that should not present a problem. For instance if you have selected one of these fields as your image sorting key then the sort will be wrong if the field is not populated. You do not correctly interpret the parameters to Maybe you should manually select the image for the thumbnail? |