Re: [Libpgf-user] Problems building pgf tools on Ubuntu 10.10
libPGF is an implementation of the Progressive Graphics File (PGF)
Brought to you by:
c_stamm
From: Leith B. <le...@le...> - 2011-12-08 23:05:08
|
Hi, I have been looking at the internals of libpgf and I now realise that libpgf is not suitable for compressing large images because all the data is read into memory before compressing and I would need a machine with 10GB of RAM to compress my image. I was hoping to use libpgf as a free alternative to ECW and JPEG2000 for compressing large datasets. Both ECW and JPEG2000 are able to compress very large images with only a small amount of RAM needed. I believe they work on a scanline by scanline basis. Does the libpgf encoding internals use the whole image at once or could it be modified to use scanline by scanline? Does the ROI mode require only the current 'tile' to be in RAM? This would save a lot of RAM. I am very disappointed that wavelet compression of big datasets is still not possible with free tools... ECW is a commercial proprietary file format and ERDAS only provide the decompressor for free (they used to provide a free compressor but they made it expensive to make more $$$). JPEG2000 is an open format but all the open source compressors are either buggy and break/crash with large images or are horibbly slow or use too much RAM. So far the only decent JPEG2000 tools I have found are commercial. Kakadu is an excellent library and is very fast, ERDAS also make a decent compressor but is expensive like there ECW tools. I was hopeful when I recently discovered libPGF but now I realise it is useless just like all the other opensource stuff :-( Seems the only open source way to compress large data is with GZIPed TIFF files... Thanks, Leith Bade le...@le... On 9 December 2011 10:27, Leith Bade <le...@le...> wrote: > Hi, > > I tracked down the problem. Ubuntu 10.10 has a newer version of > FreeImage than the one included with pgf. As such the FreeImage > headers in the pgf include directory conflicted with the installed > FreeImage binary. > > It is a *really* bad idea to include library header files in Linux > source distributions. > > I fixed this by removing the include folder from makefile.am. Also now > that FreeImage supports unsigned width and height I modified the > CImage::Create function to use unsigned int instead of int, and > removed the (WORD) casts. > > I also modified the second Create function to use unsigned int for bpp > as it is a bad idea to mix unsigned/signed stuff. > > The PNMPlugin.ccpp also likely needs an update to use unsigned ints > with the updated FreeImage functions. There are some more > signed/unsigned conversions in here too. > > I now have the program compiled. > > Unfortunately it appears the program won't open my 9.9GB TIFF data > that I want to compress: > Error: Could not load source file. > > Does the FreeImage library handle BigTIFF files? ie files > 4GB. > > If it doesn't I am going to have to write some sort of plugin for GDAL > to convert my files. > > Does PGF define a format for storing geospatial information, or will I > have to define my own? (Possibly create a new standard for it) > > Thanks, > Leith Bade > le...@le... > > > > On 9 December 2011 09:02, Leith Bade <le...@le...> wrote: >> Hi, >> >> I am trying to install the pgf tools on Ubntu 10.10 but I get some >> really strange linker errors about FreeImagePlus: >> libtool: link: g++ -g -O2 -o pgf PNMPlugin.o CImage.o PGF.o >> -lfreeimageplus /usr/lib/libpgf.so >> CImage.o: In function `CImage::Create(int, int, unsigned char)': >> /home/leith/projects/pgf-6.11.42/src/CImage.cpp:93: undefined >> reference to `fipImage::setSize(FREE_IMAGE_TYPE, unsigned short, >> unsigned short, unsigned short, unsigned int, unsigned int, unsigned >> int)' >> /home/leith/projects/pgf-6.11.42/src/CImage.cpp:73: undefined >> reference to `fipImage::setSize(FREE_IMAGE_TYPE, unsigned short, >> unsigned short, unsigned short, unsigned int, unsigned int, unsigned >> int)' >> CImage.o: In function `CImage::Create(int, int, int)': >> /home/leith/projects/pgf-6.11.42/src/CImage.cpp:44: undefined >> reference to `fipImage::setSize(FREE_IMAGE_TYPE, unsigned short, >> unsigned short, unsigned short, unsigned int, unsigned int, unsigned >> int)' >> CImage.o: In function `CImage': >> /home/leith/projects/pgf-6.11.42/src/CImage.cpp:29: undefined >> reference to `fipImage::fipImage(FREE_IMAGE_TYPE, unsigned short, >> unsigned short, unsigned short)' >> /home/leith/projects/pgf-6.11.42/src/CImage.cpp:29: undefined >> reference to `fipImage::fipImage(FREE_IMAGE_TYPE, unsigned short, >> unsigned short, unsigned short)' >> >> I have installed the Ubuntu libfreeimage-dev package, and it seems to >> be finding the .so as before I installed libfreeimage ld complained >> that it could not find it. >> >> The strange thing is that the errors reference parameter typed of >> "unsigned short", but the header FreeImagePlus.h defines the >> parameters as just "unsigned". Where is ld getting the idea that they >> should be "unsigned plus"? >> >> Removing the "(WORD)" casts from CImage.cpp did not seem to change anything. >> >> Thanks, >> Leith Bade >> le...@le... |