Author Topic: libtiff 3.9.4 extension for fpc.  (Read 1789 times)

Offline nomas

  • Imaging User
  • *
  • Posts: 23
    • View Profile
libtiff 3.9.4 extension for fpc.
« on: 12 December 2013, 08:53:54 »
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


Offline nomas

  • Imaging User
  • *
  • Posts: 23
    • View Profile
libtiff 4.0.3 extra
« Reply #1 on: 14 December 2013, 15:32:50 »
Tiff's Jpeg codec is not work  :(

libtiff 4.0.3 apply for FPC  :D


Offline Galfar

  • Administrator
  • Imaging User
  • *****
  • Posts: 351
    • View Profile
    • Galfar's Homepage
Re: libtiff 3.9.4 extension for fpc.
« Reply #2 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?

Offline nomas

  • Imaging User
  • *
  • Posts: 23
    • View Profile
Re: libtiff 3.9.4 extension for fpc.
« Reply #3 on: 16 December 2013, 07:40:55 »
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

I have still problem on jpeg codec.
« Last Edit: 16 December 2013, 07:59:46 by nomas »

Offline nomas

  • Imaging User
  • *
  • Posts: 23
    • View Profile
Re: compiled 4.0.3 object files.
« Reply #4 on: 16 December 2013, 08:03:38 »
Only o files there. works on FPC only.  :-[

Offline nomas

  • Imaging User
  • *
  • Posts: 23
    • View Profile
Jpeg codec problem fixed.
« Reply #5 on: 28 December 2013, 20:24:17 »
In Libdelphi.pas,

Code: [Select]
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,

Code: [Select]
      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);       

« Last Edit: 29 December 2013, 03:29:11 by nomas »