Brian,

  On my MacBook Pro I run both j701 & j602 (but the 602 uses the
701 engine: 9!:14'' gives j701/2011-01-10/11:25). At any rate,
your bit of code did let me read and display the "atkiln.jpg"
image. So I went ahead and commented out the  raw_read_jpeg
verb in j602/addons/media/image3/image3.ijs and inserted

   raw_read_jpeg=:i_to_rgb@readimg
   i_to_rgb=: a.i.[:}."1($,4:)$(2&ic)@,

instead. Magic! I don't if this patch will hold, but at least I'm
able to start doing the examples in Cliff's book: loading dwin2 and
drawing the polygons ... At the moment this is all hieroglyphics to
me, I'll try to understand what's going on later.

                         Thanks for the help with this,
                                              Patrick

On Sun, 9 Dec 2012, Brian Schott wrote:
Patrick,

With help from Cliff I am able to make the following patch to image3
using j602* on my Mac with Lion. A key feature of this approach is the
verb i_to_rgb which I believe Cliff said comes from an experimental
Windows version. The original version of i_to_rgb is shown below,
also. The patch uses the image/platimg addon to do the reading. This
patch only works with jpeg images but with some snooping and further
adaptation could be altered to work with others, I believe.

I don't know how versatile this patch can be, but you are welcome to
play with it, and I would be happy to discuss it further.

Note 'jpg'
directory =: jpath '~addons/media/image3/'
load '~addons/media/image3/view_m.ijs'
load '~addons/media/platimg/platimg.ijs'
raw_read_jpeg=:i_to_rgb@readimg
NB. i_to_rgb=:[:|."1^:IFJ6 a.i.[:}:"1($,4:)$(2&ic)@,
i_to_rgb=: a.i.[:}."1($,4:)$(2&ic)@,
view_image directory,'atkiln.jpg'
$c=:raw_read_image directory,'atkiln.jpg'
view_image c
)



*Really, I am using a version that is a 32 bit version which I have
name j60232 on my Mac, but cannot remember exactly where that came
from.




----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to