EnglishHi rvelices,
I just gave a look at how the coi is stored in the database:
mysql> select coi from piwigo_images where coi is not null; +------+ | coi | +------+ | mbsj | | hbul | | garh | | kcqg | | lazk | | fbtl | +------+ 6 rows in set (0.00 sec)
can you explain what it means and how it's used in the code?
Offline
4 letters: left, top, right, bottom of center of interest as a fraction encoded as a = 0 z = 1
function char_to_fraction($c)
{
return (ord($c) - ord('a'))/25;
}
function fraction_to_char($f)
{
return ord('a') + round($f*25);
}used in class ImageRect crop_h() and crop_v() (derivative_params.inc.php)
Offline
OK, understood, very "compressed" way to store this information :-)
Thank you for explanation.
Offline
Zaphod wrote:
[...] that's just awesome.
I agree. It is not a very easy concept but highly powerful and we can see the result "live" on all "cropped" sizes.
Offline