|
From: | Ben Abbott |
Subject: | Re: Fixing imread() on Macs with an oct-file? |
Date: | Fri, 28 Jun 2013 08:46:34 +0000 (GMT) |
Hi.
The imread() call on the Macports download of Octave has been broken for
years. It is missing a call to InitializeMagic().
One can fix this by building Octave from scratch, but I have done this once
and I know how hard it can be. I do not do enough work on the Mac to justify
doing a huge effort, so I have a workaround. However, it would be neater if
I could share my stuff with other people who use Macs with use the Macports
binary.
It struck me last night that I could stick the missing InitializeMagic()
call into a .oct file. This isn't a great solution but you only need to run
it once, and you could stick it into your octave startup sequence. So, I
wrote an InitializeMagick.cpp file containing the missing call. I have tried
linking in the Magick++ library using the mkoctfile -l option, but so far no
luck.
Is this capable of working? As it's Friday, is anyone bored enough to have a
go?
Cheers.
Richard
I'm building Octave using Macports for dependencies. I don't see the problem you describe.
img = 1 ./ hilb (11);
imwrite (img, jet, 'foo.png', 'png')
img2 = imread ('foo.png')
img2 =
ans(:,:,1) =
0 0 0 0 0 0 0 0 43 85 128
0 0 0 0 0 0 0 43 85 128 170
0 0 0 0 0 0 43 85 128 170 213
0 0 0 0 0 43 85 128 170 213 255
0 0 0 0 43 85 128 170 213 255 255
0 0 0 43 85 128 170 213 255 255 255
0 0 43 85 128 170 213 255 255 255 255
0 43 85 128 170 213 255 255 255 255 255
43 85 128 170 213 255 255 255 255 255 255
85 128 170 213 255 255 255 255 255 255 255
128 170 213 255 255 255 255 255 255 255 213
ans(:,:,2) =
0 0 43 85 128 170 213 255 255 255 255
0 43 85 128 170 213 255 255 255 255 255
43 85 128 170 213 255 255 255 255 255 255
85 128 170 213 255 255 255 255 255 255 255
128 170 213 255 255 255 255 255 255 255 213
170 213 255 255 255 255 255 255 255 213 170
213 255 255 255 255 255 255 255 213 170 128
255 255 255 255 255 255 255 213 170 128 85
255 255 255 255 255 255 213 170 128 85 43
255 255 255 255 255 213 170 128 85 43 0
255 255 255 255 213 170 128 85 43 0 0
ans(:,:,3) =
213 255 255 255 255 255 255 255 213 170 128
255 255 255 255 255 255 255 213 170 128 85
255 255 255 255 255 255 213 170 128 85 43
255 255 255 255 255 213 170 128 85 43 0
255 255 255 255 213 170 128 85 43 0 0
255 255 255 213 170 128 85 43 0 0 0
255 255 213 170 128 85 43 0 0 0 0
255 213 170 128 85 43 0 0 0 0 0
213 170 128 85 43 0 0 0 0 0 0
170 128 85 43 0 0 0 0 0 0 0
128 85 43 0 0 0 0 0 0 0 0
Ben
[Prev in Thread] | Current Thread | [Next in Thread] |