Author Topic: vampyre can't load Tiff under Lazarus Mac OSX  (Read 5949 times)

Offline jus

  • Imaging User
  • *
  • Posts: 7
    • View Profile
vampyre can't load Tiff under Lazarus Mac OSX
« on: 21 June 2011, 01:19:57 »
Hi,
   I'm using the latest vampyre trunk and Lazarus 0.9.31 (FPC 2.4.2) under Mac OSX 10.6 and I have just noticed that DetermineFileFormat,DetermineStreamFormat don't work for TIF files. The result string is empty. It works for JPG, but not for TIF.

Edit:
It seems that there is not only a with DetermineStreamFormat, but with loading tiff in Max OSX.

Kindly regards,
jus
« Last Edit: 21 June 2011, 11:13:48 by jus »

Offline Galfar

  • Administrator
  • Imaging User
  • *****
  • Posts: 351
    • View Profile
    • Galfar's Homepage
Re: vampyre can't load Tiff under Lazarus Mac OSX
« Reply #1 on: 5 July 2011, 17:59:49 »
Hi, TIFF support in Imaging is provided by LibTiffDelphi library that uses precompiled
libtiff C library. Unfortunately, that's only available for Delphi.
There's test version of GCC compiled libtiff for Imaging in this thread that's usable in Lazarus.

jsj

  • Guest
Re: vampyre can't load Tiff under Lazarus Mac OSX
« Reply #2 on: 30 April 2012, 00:19:00 »
I was made gcc compiling libtiff under win gcc (mingw32).
Tiff's are loaded.

But under Mac OS don't work.
"Linking error
Id: symbol(s) not found for architecture i386"

I try to use as mingw32 obj's as mac gcc obj's.
Don't work ;(

Any ideas?

jsj

  • Guest
Re: vampyre can't load Tiff under Lazarus Mac OSX
« Reply #3 on: 4 May 2012, 22:13:30 »
Everything allright.
Tifflib under mac os is working! =)

jsj

  • Guest
Re: vampyre can't load Tiff under Lazarus Mac OSX
« Reply #4 on: 8 May 2012, 00:52:21 »
Just use "-arch i386" parameter to compile tifflib object files

Offline Galfar

  • Administrator
  • Imaging User
  • *****
  • Posts: 351
    • View Profile
    • Galfar's Homepage
Re: vampyre can't load Tiff under Lazarus Mac OSX
« Reply #5 on: 15 May 2012, 12:26:08 »
Could you please check if TIFFs with JPEG compression are working with TiffLib compiled for MacOS?

Offline jus

  • Imaging User
  • *
  • Posts: 7
    • View Profile
Re: vampyre can't load Tiff under Lazarus Mac OSX
« Reply #6 on: 16 May 2012, 17:40:54 »
Just use "-arch i386" parameter to compile tifflib object files

Hi jsj,

  I'm very insterested in using Tifflib. The problem is that I'm not very familiar with compiling c++ files. Could you please provide some more detailed information how to build such a tifflib to use it in vampyre lib? And where/which version did you use to compile? I have tried to load the libtiff source code (http://www.libtiff.org) into xcode, but it didn't worked.  :(

jus

jsj

  • Guest
Re: vampyre can't load Tiff under Lazarus Mac OSX
« Reply #7 on: 20 May 2012, 18:38:49 »
Galfar,
Tiff with jpeg codec dont supported by default (even under win32 lazarus, i cant tested it under delphi).
As I understand - tifflib must be compeled with -jpeglib parameters...

Jus, I recompiled the new imaginglib with tifflib 3.9.4
Under win32 - everything works, but under the macos - the same error again...
(ld: symbol(s) not found for architecture i386)
Maybe somebody know how to get more info from linker?
The worst thing - I seem to have forgotten the keys that I have compiled tifflib 3.9.1 (
And now again I try to resolve this problem...


PS: I can't register at this forum - get error

Offline Galfar

  • Administrator
  • Imaging User
  • *****
  • Posts: 351
    • View Profile
    • Galfar's Homepage
Re: vampyre can't load Tiff under Lazarus Mac OSX
« Reply #8 on: 20 May 2012, 20:24:43 »
PS: I can't register at this forum - get error
Please try again now.

Offline jsj

  • Imaging User
  • *
  • Posts: 2
    • View Profile
Re: vampyre can't load Tiff under Lazarus Mac OSX
« Reply #9 on: 21 May 2012, 23:31:36 »
Galfar, registration was successful =)

About tifflib under Mac - I forget compilation keys, but I have already compiled tifflib 3.9.1 under mac.
I will upload it... soon...

But with tifflib 3.9.4 under macos I have a problem..
I was build obj files for i386 architechture, but for success compilation need
Code: [Select]
{$Linklib libtiff} and libtiff.a - x86-64 architechture somehow (i view it by otool)

Therefore I need correct compilation keys.
Now I compile tifflib as:

./configure CFLAGS="-arch i386"
make

But it not enough...

PS: sorry my english, but i think you understand me))

Offline Galfar

  • Administrator
  • Imaging User
  • *****
  • Posts: 351
    • View Profile
    • Galfar's Homepage
Re: vampyre can't load Tiff under Lazarus Mac OSX
« Reply #10 on: 1 June 2012, 21:56:57 »
jsj,
seems like the problem is not in GCC, or at least not in CPU architecture.

I did some experiments and the static lib (libtiff.a) produced by GCC is different
when you use "-arch i386" than with no flags. 64bit one is roughly 2x bigger in size
than 32bit one.

Also FPC gives this message:
ld: warning: ignoring file ./libtiff64.a, file was built for archive which is not the architecture being linked (i386)
when trying to link to x86_64 library.
This message is not displayed when linking library generated with "-arch i386".

Anyway, for both libraries linking always ends with:
Undefined symbols for architecture i386:
  "_TiffGetVersion", referenced from:

Maybe symbols are not properly exported or something :(

Offline jsj

  • Imaging User
  • *
  • Posts: 2
    • View Profile
Re: vampyre can't load Tiff under Lazarus Mac OSX
« Reply #11 on: 10 June 2012, 19:48:45 »
I dont have any time to explore compiler flags, now.
I just copy here my compiled old version (3.9.1, but adaptated for 3.9.4 pas unit)

I hope that soon will deal with this.

PS: Some explanations for this version.
This code work as Windows as MacOsX.
There is two libtiff.a in pack.
libtiff.a - for mac os
libtiff-win.a - for windows (for compile - rename it to libtiff.a)

PPS: For compiling I use this link :
  http://www.kyngchaos.com/macosx/build/libtiff
  (some compiler flags are here)
« Last Edit: 10 June 2012, 20:00:05 by jsj »

Mauricio

  • Guest
Re: vampyre can't load Tiff under Lazarus Mac OSX
« Reply #12 on: 26 March 2013, 11:02:13 »
Hi,

i will try this on Delphi XE3 today.

Mauricio

Mauricio

  • Guest
Re: vampyre can't load Tiff under Lazarus Mac OSX
« Reply #13 on: 26 March 2013, 11:27:37 »
Hi again,

i have tryied compiling from Delphi XE3 to macOSX with extensions.zip files above.

I have the following errors on LibTiffDelphi.pas :


line 3:
  {$Linklib libtiff}
Says: invalid compiler directive 'Linklib'


line 564: (last line)
Says: Bad object file format : 'D:\_DELPHI XE3\_COMPONENTS\Vampyre\Extras\Extensions\LibTiff\Compiled\macosx\jmemnobs.o'

Please, help me.
Mauricio

Offline Galfar

  • Administrator
  • Imaging User
  • *****
  • Posts: 351
    • View Profile
    • Galfar's Homepage
Re: vampyre can't load Tiff under Lazarus Mac OSX
« Reply #14 on: 3 March 2014, 17:42:53 »
I've been working on TIFF loader/saver for Imaging that won't need LibTiff as compiled objects
so in few weeks there will be TIFF support on more platforms (and LibTiff only as an option).