Long time passed for FPC release :P
I have some modification for FPC and remove dependency 'windows' unit.
but only for 32bit. If you use in 64bit there is a some modification needed in C source files.
Many of parameters defined longint in C sources.
There is a 'makeobjs-gcc.bat' in archive file, you can recompile object files. I'm using 'mingw' gcc.
It compiled ok in FPC 2.7.1
Tiff's Jpeg codec is not work :(
libtiff 4.0.3 apply for FPC :D
Thanks for this work.
I want to include your LibTiffDelphi FPC modification in Imaging's repository (in Extras\Contrib).
But now I'm little confused what parts of which archive are needed.
Are compiled object files and *.pas files from 4.0.3 archive enough?
Quote from: Galfar on 16 December 2013, 00:37:44
Thanks for this work.
I want to include your LibTiffDelphi FPC modification in Imaging's repository (in Extras\Contrib).
But now I'm little confused what parts of which archive are needed.
Are compiled object files and *.pas files from 4.0.3 archive enough?
I worked on libtiff 4.0.3 base. libtiff 3.9.4 archives pas source is not work on 4.0.3 there is some changes.
I have new one for fpc fpc 64bit support. :)
Revised some functions(sprintf) for FPC(pointer problem). now Error message was shown correctly.
mingw 11.4 is used for object compiling.
http://nuwen.net/mingw.html (http://nuwen.net/mingw.html)
I have still problem on jpeg codec.
Only o files there. works on FPC only. :-[
In Libdelphi.pas,
procedure memset(a: Pointer; b: Integer; c: PtrUInt); cdecl;
begin
system.FillChar(a^,c,b); // swap "b" and "c"
end;
Now It works fine :)
Also changes in Imaginglibtiffdelphi.pas,
TiffResult := TIFFReadRGBAImageOriented(Tiff, Images[Idx].Width, Images[Idx].Height,
Images[Idx].Bits, Orientation, 0);
if TiffResult = 0 then
RaiseImaging(LastError, []);
// swap Red and Blue, if YCbCr.
if Photometric=PHOTOMETRIC_YCBCR then
SwapChannels(Images[Idx],ChannelRed,ChannelBlue);
Precompiled LibTiff for FPC has been finally added to Imaging for Win32 and Win64.
In Linux it's now using dynamic linking to libtiff since there it's already installed on most systems or simple to install where not.
Great library!
Have you planned a TIFF support also for FPC on Mac OS?
And what have to be done to do that? Isn't the LibTiff compilation also working on the Mac? Or is it very different to Windows or Linux?
It's not very different but the the end result does not work yet :( There are crashes that I have not yet figured out.
What works fine in MacOS now is dynamic linking to libtiff like in Linux. It's not enabled by default though
since I guess not many Mac users have libtiff installed (contrary to Linux situation).
Very good to hear that you are working on a solution.
Yes, I think so, too. Then it is much better to use the solution like Windows than relying on an external library.