• Welcome to Vampyre Imaging Library Forum. Please login or sign up.
 

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - mos

1
Help & Questions / Re: Jpeg2000 and Mac OSX
11 June 2009, 11:31:37
My project test work on 4 DICOM files, on this files the image data begin with a offset of 1680, so it's necessary to skip DICOM header.

The attached project work well for 3 files:

8-bit J2K Lossy Gray.dcm
8-bit J2K Lossless Gray.dcm
8-bit JPEG Lossy Gray.dcm

but failed with this:

8-bit JPEG Lossless Gray.dcm 

I obtain this exception:
"Project raised exception class 'EImagingError" with message:
JPEG Error: 61 (Unsupported JPEG process: SOF type $%02x)"

The problem is present under Windows, Linux and Mac OSX.

In debugging I found that the exception is generated by follow code in imjdmarker.pas@2221:

...
      M_SOF3,                     { Lossless, Huffman }
      M_SOF5,                     { Differential sequential, Huffman }
      M_SOF6,                     { Differential progressive, Huffman }
      M_SOF7,                     { Differential lossless, Huffman }
      M_JPG,                      { Reserved for JPEG extensions }
      M_SOF11,                    { Lossless, arithmetic }
      M_SOF13,                    { Differential sequential, arithmetic }
      M_SOF14,                    { Differential progressive, arithmetic }
      M_SOF15:                    { Differential lossless, arithmetic }
        ERREXIT1(j_common_ptr(cinfo), JERR_SOF_UNSUPPORTED, cinfo^.unread_marker);   
...

where cinfo^.unread_marker = M_SOF3 (195) so I think that the decompress algorithm cannot manipulate Lossless Huffman compression?
2
Yes you have right, now I have seen that in FreePascal the CopyMemory is implemented through a Move! Under Windows I have always used winapi CopyMemory  :(

I must read the FreePascal documentation.

Thanks for your suggestion.
3
I have the necessity to store in a buffer the bits image so I use this code:


  ...
    FBitmap: TImagingBitmap;
    FImage: TSingleImage;
    s: LongInt;
    gbuff: Pointer;
  ...

  FImage := TSingleImage.Create;
  FBitmap := TImagingBitmap.Create;
  Image.Picture.Graphic := FBitmap;
  ...
  FImage.LoadFromFile('test.jpg');
  Image.Picture.Graphic.Assign(FImage);
  s := FImage.Size;
  GetMem(gbuff, s);
  {$ifdef Linux}
  Move(FImage.Bits, gbuff, s);
  {$endif}
  {$ifdef Win32}
  CopyMemory(gbuff, FImage.Bits, s);
  {$endif}


The code work well under Windows but under Linux I get an exception on Move instruction.

I use Lazarus 0.9.26 & fpc 2.2.2, WinXP+SP2, Linux Fedora Core 8.

In the attached file there is the complete source code.


Can you help me?

Thanks & goodbye
4
Help & Questions / Re: Jpeg2000 and Mac OSX
4 June 2009, 11:29:20
Yes, I have used the makefile included in the source of OpenJpeg, in my OSX I use GCC version 4.0.1 build 5465.

Now I'm do some test with JPEG lossless because I have a problem with an image, this problem is not present under Linux and Windows.

5
Help & Questions / Re: Jpeg2000 and Mac OSX
2 June 2009, 10:57:42
Thanks for your answer, I have compiled OpenJpeg with CDEF patch under my OSX.

I have encountered two problem, the first is relative to malloc.h resolved with a symbolic link
ln -s /usr/include/malloc/malloc.h /usr/include/malloc.h

and the second is relative to _memalign resolved modifying the opj_malloc.h as

#else /* Not WIN32 */
   #if defined(__sun)
      #define HAVE_MEMALIGN
   #elif defined(__GNUC__)
      #ifndef __APPLE__
         #define HAVE_MEMALIGN
         #include <malloc.h>
      #endif
   /* Linux x86_64 and OSX always align allocations to 16 bytes */
   #elif !defined(__amd64__) && !defined(__APPLE__)   
      /* FIXME: Yes, this is a big assumption */
      #define HAVE_POSIX_MEMALIGN
   #endif
#endif


In the attached file there's the new libopenjpeg.a that work fine under Mac OSX (i386).


Goodbye

6
Help & Questions / Jpeg2000 and Mac OSX
31 May 2009, 16:46:25
I have tried to porting JPEG2000 under Mac OSX.

From the package http://www.openjpeg.org/openjpeg_v1_3_osx.zip I have extract two file

libopenjpeg.dylib,
libopenjpeg.a

and put these on follow directory

(Imaging Root)\Source\Extras\Extensions\J2KObjects

with others library. Then I have modified the file (Imaging Root)\Source\Extras\Extensions\OpenJpeg.pas
to load the static library (see attached OpenJpeg.pas).

But when execute the program in attached project, I obtain an exception error, see screenshot.


Can you help me?


Thanks and goodbye
7
Help & Questions / Re: Lazarus, Vampyre & MacOS?
2 February 2009, 16:34:15
Thank you very much, now I'm happy and I can continue to use your fantastic library!
9
Help & Questions / Re: Lazarus, Vampyre & MacOS?
1 February 2009, 13:07:36
With the 2nd method found on this tutorial http://pcwizcomputer.com/index.php?option=com_content&task=view&id=31&Itemid=32 I have set my resolution to 1440x900.
10
Help & Questions / Re: Lazarus, Vampyre & MacOS?
31 January 2009, 17:49:14
I also work on VMWare on WinXP+SP2, all works very fine, also Internet and local network.
But now my PC has got 4GB of RAM, because with 2GB I can't enable to install OSX on VMWare.
First I have installed XCode 3.0 then Lazarus 0.9.26 and at last Imaging Library.
In installation software I don't have found any problem, it's gone very smooth.

I continue with my tests:

First, I have converted Tigers.jpg to Tigers24.bmp (a 24 bit bitmap), so I have not any conversion in the code.

Then I execute this code:

ImgBmp: TImagingBitmap;
Image1: TImage;
...
ImgBmp := TImagingBitmap.Create;
ImgBmp.LoadFromFile('Tigers24.bmp');
Image1.Picture.Graphic := ImgBmp;
Image1.Picture.SaveToFile('Tigers24-3.bmp');

The image displayed on the form (Image1 instance of TImage) is garbled, instead Tigers24-3.bmp is correct.

After I execute this code:

ImgBmp: TBitmap;
Image1: TImage;
...
ImgBmp := TBitmap.Create;
ImgBmp.LoadFromFile('Tigers24.bmp');
Image1.Picture.Graphic := ImgBmp;
Image1.Picture.SaveToFile('Tigers24-3.bmp');

Where the only different is ImgBmp type. Both images, displayed and saved, are correct.

11
Help & Questions / Re: Lazarus, Vampyre & MacOS?
31 January 2009, 14:05:49
I work on this platform:

Mac OSX 10.5.4 + XCode 3.0
Lazarus 0.9.26 (Carbon LCL Widget)
Imaging Library 0.26.2


Can you suggest me other test to find where is the problem?




12
Help & Questions / Re: Lazarus, Vampyre & MacOS?
30 January 2009, 17:22:38
I also try this Low Level Interface of library:


  ImgJpeg := TImagingJpeg.Create;
  InitImage(ImgData);
  LoadImageFromFile('img002.jpg', ImgData);
  SaveImageToFile('img002-1.jpg', ImgData);
  ImgJpeg.AssignFromImageData(ImgData);
  ImgJpeg.SaveToFile('img002-2.jpg');
  Image1.Picture.Graphic := ImgJpeg;
  Image1.Picture.SaveToFile('img002-3.jpg');


and all the saved images (img002-1.jpg, img002-2.jpg, img002-3.jpg) are corrects.
Only the displayed image is garbled.

Instead if I use TImage component with this code:


Image1.Picture.LoadFromFile('img002.jpg');


the displayed image is ok.


13
Help & Questions / Re: Lazarus, Vampyre & MacOS?
30 January 2009, 13:54:35
I try this code:


...
    Image1: TImage;
    FBitmap1: TImagingBitmap;
    FImage1: TMultiImage;
...

  FImage1 := TMultiImage.Create;
  FBitmap1 := TImagingBitmap.Create;
  Image1.Picture.Graphic := FBitmap1;

  FImage1.LoadMultiFromFile('Tigers.jpg');
  Image1.Picture.Graphic.Assign(FImage1);

  Image1.Picture.SaveToFile('Tigers-1.jpg');
  FImage1.SaveToFile('Tigers-2.jpg');


in the attached files you can see the images displayed using the Preview of OSX.
The size of Tigers-1.jpg is 888KB, the size of Tigers-2.jpg is 48 and original Tigers.jpg size is 46KB.

So I think that problem is on conversion to bitmap, is it right?
14
Help & Questions / Re: Lazarus, Vampyre & MacOS?
28 January 2009, 19:48:02
I'm trying the library under Mac OS X 10.5.4 Leopard (Intel), the compilation process work fine but the image colors are not correct.
In the attached file you can see the result with your Tigers.jpg.

Have you got any suggestion?


Thanks and goodbye
15
Help & Questions / Lazarus, Vampyre & MacOS?
22 October 2008, 19:32:37
Granted that I have not a Mac, but it's possible to compile Vampyre Library under MacOS with Lazarus?


Thanks
SMF spam blocked by CleanTalk