Re: [Digilib-devel] last row filled with black pixels
A versatile image viewing environment for the internet
Brought to you by:
robcast
From: Robert C. <ca...@mp...> - 2014-04-24 14:05:14
|
Hi Mathias, On 24.04.14 12:55, Mathias Göbel wrote: > I use the digilib scaler to extract parts of larger images and include them in a > digital edition. I recently observed an reproducible issue. Some images returned > by the scaler come with a (last) row and (last) column filled with black pixels. > You can see an example here: > >>http://141.5.101.102/digilib/Scaler?&fn=C07_062.jpg&dw=500&dh=500&wx=0.49559520812353136&wy=0.16589224303043199&ww=0.3766523581738838&wh=0.3066492977229197 > > > I wonder why the resulting images width is 501px, but dw is set to 500. > If I change the dh/dw parameters, the results comes - as expected - without the > black lines. > http://141.5.101.102/digilib/Scaler?&fn=C07_062.jpg&dw=1500&dh=1500&wx=0.49559520812353136&wy=0.16589224303043199&ww=0.3766523581738838&wh=0.3066492977229197 > But the result is still one pixel larger than the parameter defines. digilib has some rounding issues especially with high zoom factors which lead to wrong calculations of the resulting image size. Depending on the image format additional pixels are either black (from JPG) or transparent (PNG from TIFF). Which version of digilib are you using? The precision of calculations was improved in October 2013 (Scaler version 2.2.3 <http://sourceforge.net/p/digilib/code/ci/21441a3f52085048378806b8c0eeff21e0bd3a64/>) but there are still issues with big zoom factors. The current code that calculates sizes (getScaleXY and related in http://sourceforge.net/p/digilib/code/ci/tip/tree/common/src/main/java/digilib/image/ImageJobDescription.java) has rather complicated side-effects and I haven't found the core of the rounding problem yet. (patches are welcome :-) Best Robert -- Dr. Robert Casties -- Information Technology Group Max Planck Institute for the History of Science Boltzmannstr. 22, D-14195 Berlin Tel: +49/30/22667-342 |