K4kArot2015 / sigplus

Automatically exported from code.google.com/p/sigplus
0 stars 0 forks source link

performance Optimization #99

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi!
Is the change in the organization of directories while no change files 
themselves must enforce all thumbnail generation again?

Best Regards!

Original issue reported on code.google.com by ten.mari...@gmail.com on 13 Dec 2013 at 8:31

GoogleCodeExporter commented 9 years ago
Not necessarily. Currently, there are two modes of operation.

(1) When the generated images are stored in Joomla's cache folder, sigplus uses 
a one-way hash to map the image file to a thumbnail or preview image file name. 
This hash involves the location of the original image, which is why it triggers 
a re-generation of images when you move a directory sub-tree. On the other side 
of the coin, the hash does not involve the contents (bytes) of the original 
image, and is therefore easier to compute and does not require reading the 
original file itself to calculate the hash value. Your suggestion, on the other 
hand, would require reading the image into memory and computing the hash based 
on the image contents, and not mostly based on external characteristics as is 
currently done.

(2) When the generated images are not stored in Joomla's cache folder, the 
situation is much simpler and no hash value is needed, the thumbnail and 
preview images are saved under a sub-folder of the directory where the original 
images are. You can move directory sub-trees freely, which will not trigger 
image re-generation as the relative path remains unchanged.

Original comment by huny...@gmail.com on 13 Dec 2013 at 8:49

GoogleCodeExporter commented 9 years ago
I understand. Therefore, it seems prudent to use the "sub-folder of the 
directory where the original images are". OK.

I have only one problem.
Individual users have made ​​available their directories on the server to 
copy the pictures.

When they sync via FTP (with "remove orphan") directory on your HDD to your 
directory on the server, working directories sigplus will be automatically 
removed. This means that after each synchronization sigplus must create its 
working directory.

In this use case, in fact, the greater the optimization of cache SigPlus when I 
get a directory of Joomla! inseparable for the users.

Original comment by ten.mari...@gmail.com on 13 Dec 2013 at 9:06

GoogleCodeExporter commented 9 years ago
In such a case, if I understand correctly, you might be better off using the 
sigplus mode that utilizes the Joomla cache folder. But then the standard 
behavior should also fit you perfectly as the user root directories do not move 
about freely in the file system and the hash value computed based on the 
original image location should cause no problems unless the user moves their 
own images.

Original comment by huny...@gmail.com on 13 Dec 2013 at 9:13

GoogleCodeExporter commented 9 years ago
The problem I noticed when changing only organization directories.
was:
images / animal / owl
on
images/animal/world/2012/owl

Original comment by ten.mari...@gmail.com on 13 Dec 2013 at 9:38

GoogleCodeExporter commented 9 years ago
Maybe a good compromise would be to SIGPlus your cache set to the directory 
holding the destination directory with a dot? Then you can hide these folders 
in the FTP client connections.

Original comment by ten.mari...@gmail.com on 18 Dec 2013 at 8:20

Attachments:

GoogleCodeExporter commented 9 years ago
Setting the target folder names where images are generated has been supported 
from the very start. The default target folders are "thumb", "preview", 
"fullsize" and "watermarked" but you can set any name you like on the Advanced 
settings tab of the sigplus plug-in configuration page in the administration 
back-end. The name can start with a dot or any other character your operating 
system supports.

Original comment by huny...@gmail.com on 19 Dec 2013 at 11:04

GoogleCodeExporter commented 9 years ago
Well, of course! I apologize for not thinking. You're right, I'll be testing!

Original comment by ten.mari...@gmail.com on 19 Dec 2013 at 11:36

GoogleCodeExporter commented 9 years ago
Unfortunately. I'm sorry, my bad idea.
I checked some ftp client programs and each of them during the synchronization 
is taken as a directory with a dot is not visible, but it is copied.

Original comment by ten.mari...@gmail.com on 19 Dec 2013 at 4:53