[IPOL discuss] Fast image loading
Miguel Colom
colom at cmla.ens-cachan.fr
Sun Sep 7 14:05:26 CEST 2014
Dear all,
as you may have noticed in the demos, sometimes there's a delay
between the time you click on an image of the demo and the time the
parameters page appears.
This is caused by internal format conversions performed by the demo
system to ensure that the binary program will receive the images in
the format it needs and also to create versions of the images that can
be displayed on the web with the proper sizes.
However, most of the time these kind of conversions are not needed.
For example, if the input image is PNG, it doesn't need to be
converted again into PNG. Also, most of the these operations can be
executed in parallel.
So, I did these changes:
- Parallelization of all conversions that can be performed at the same time.
- Only convert input files is necessary. If not, just copy the input
(after a security check, of course).
Therefore, from now you should observe a drastic increase in the
images loading speed.
Of course, if conversions are needed (say, the input image is JPEG and
the binary needs PNG), the process will slow down, but it will be
parallelized anyway.
In case of PNG images (the format that most of the demos and users
prefer), the performance is now really improved.
Best,
Miguel
PS: this change has affected files base_app.py and image.py in lib/
More information about the discuss
mailing list