PNG Writer

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

PNG Writer

Terry Raymond

Is there a PNG Writer available for VW 7.6?

 

I found a PNG Writer in the public repository, but it appeared to use parcels

that are no longer in 7.6.

 

Terry

 

===========================================================

Terry Raymond

Crafted Smalltalk

80 Lazywood Ln.

Tiverton, RI  02878

(401) 624-4517      [hidden email]

===========================================================

 


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: PNG Writer

Runar Jordahl
Did you try PNGImageWriter? I used it with 7.8 and 7.7.1. I think I
used it with 7.6, but have not checked yet.

Runar Jordahl
blog.epigent.com

2012/1/20 Terry Raymond <[hidden email]>:

> Is there a PNG Writer available for VW 7.6?
>
>
>
> I found a PNG Writer in the public repository, but it appeared to use
> parcels
>
> that are no longer in 7.6.
>
>
>
> Terry
>
>
>
> ===========================================================
>
> Terry Raymond
>
> Crafted Smalltalk
>
> 80 Lazywood Ln.
>
> Tiverton, RI  02878
>
> (401) 624-4517      [hidden email]
>
> ===========================================================
>
>
>
>
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
>

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: PNG Writer

Travis Griggs-4
In reply to this post by Terry Raymond

On Jan 20, 2012, at 10:41 AM, Terry Raymond wrote:

Is there a PNG Writer available for VW 7.6?
 
I found a PNG Writer in the public repository, but it appeared to use parcels
that are no longer in 7.6.

I don't know off top of my head, how back the Cairo stuff goes for this… I know some people have back ported and running on earlier VW versions even. If you have Cairo, you can do

BehaviorIcons Rectangle image copy becomeCairoCompatible newCairoSurfaceWhile: [:s | s writeToPng: '/Users/travis/Desktop/theRectangle.png']

(I'm not sure I needed the copy or not, but it seemed safe)

--
Travis Griggs
Objologist
Simplicity is the Ultimate Sophistication -- Leonardo da Vinci


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: PNG Writer

John Brant-2
In reply to this post by Terry Raymond
On 1/20/2012 12:41 PM, Terry Raymond wrote:
> Is there a PNG Writer available for VW 7.6?
>
> I found a PNG Writer in the public repository, but it appeared to use
> parcels
>
> that are no longer in 7.6.

I'm guessing that you found the PNGImageWriter package. That package
requires that you load one of the ZLib packages. I think you can load
any of "Compression-ZLibWrite", "ZLibInterface" or "ZLib Interface".


John Brant
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: PNG Writer

Terry Raymond
John

Yes, that was the problem. I needed to load it from the repositiory. I was
confused because I could not find it in the parcels

Thanks.

Terry

===========================================================
Terry Raymond
Crafted Smalltalk
80 Lazywood Ln.
Tiverton, RI  02878
(401) 624-4517      [hidden email]
===========================================================

> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On
> Behalf Of John Brant
> Sent: Friday, January 20, 2012 4:25 PM
> To: [hidden email]
> Subject: Re: [vwnc] PNG Writer
>
> On 1/20/2012 12:41 PM, Terry Raymond wrote:
> > Is there a PNG Writer available for VW 7.6?
> >
> > I found a PNG Writer in the public repository, but it appeared to use
> > parcels
> >
> > that are no longer in 7.6.
>
> I'm guessing that you found the PNGImageWriter package. That package
> requires that you load one of the ZLib packages. I think you can load any
of
> "Compression-ZLibWrite", "ZLibInterface" or "ZLib Interface".
>
>
> John Brant
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc



_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: PNG Writer

Steven Kelly
Re: [vwnc] PNG Writer
Sorry if there was any confusion, Terry. As the PNGImageWriter package comment says:
 
"To use this, you will need to load either the Compression-ZLibWrite package, the Compression parcel (from the goodies parcels directory) or the ZLibInterface parcel."
 
The best is mentioned first, and is a package. As I've worked on John's original code over the last 5 years, I've wanted to keep its original ability to use any of several ZLib interfaces. The prerequisite mechanism doesn't allow alternative prereqs, so I've left loading one as a manual step.
 
Since Compression-ZLibWrite will work in any VW from the last 4 years at least, maybe I should just go ahead and add it as a prerequisite?
 
PNGImageWriter was added to the VW distro some time after 7.7.1, so it and Compression-ZLibWrite should be available in current VW versions as parcels too.
 
Steve
 


From: [hidden email] on behalf of Terry Raymond
Sent: Sat 21/01/2012 00:20
To: 'John Brant'; [hidden email]
Subject: Re: [vwnc] PNG Writer

John

Yes, that was the problem. I needed to load it from the repositiory. I was
confused because I could not find it in the parcels

Thanks.

Terry

===========================================================
Terry Raymond
Crafted Smalltalk
80 Lazywood Ln.
Tiverton, RI  02878
(401) 624-4517      [hidden email]
===========================================================


> -----Original Message-----
> From: [hidden email] [[hidden email]] On
> Behalf Of John Brant
> Sent: Friday, January 20, 2012 4:25 PM
> To: [hidden email]
> Subject: Re: [vwnc] PNG Writer
>
> On 1/20/2012 12:41 PM, Terry Raymond wrote:
> > Is there a PNG Writer available for VW 7.6?
> >
> > I found a PNG Writer in the public repository, but it appeared to use
> > parcels
> >
> > that are no longer in 7.6.
>
> I'm guessing that you found the PNGImageWriter package. That package
> requires that you load one of the ZLib packages. I think you can load any
of
> "Compression-ZLibWrite", "ZLibInterface" or "ZLib Interface".
>
>
> John Brant
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc



_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: PNG Writer

Steven Kelly
In reply to this post by Travis Griggs-4

Travis Griggs wrote:

On Jan 20, 2012, at 10:41 AM, Terry Raymond wrote:

     Is there a PNG Writer available for VW 7.6?

I don't know off top of my head, how back the Cairo stuff goes for this… I know some people have back ported and running on earlier VW versions even. If you have Cairo, you can do

 

BehaviorIcons Rectangle image copy becomeCairoCompatible newCairoSurfaceWhile: [:s | s writeToPng: '/Users/travis/Desktop/theRectangle.png']

Just to note that the Cairo stuff is faster than PNGImageWriter, with the downside being the reliance on an external library (and the VW Cairo code). Since we have Cairo loaded anyway, our app uses Cairo if available, but falls back to PNGImageWriter elsewhere.

 

If you’re already using Cairo to draw the image contents, it’s fastest to write from the pixmap rather than reify to an Image. Including the extra optimization of avoiding the Image, this gives us a total time saving of 30-50% compared to PNGImageWriter:

 

myPixmap newCairoSurfaceWhile: [:s | s writeToPng: myFilenameOrString]

 

Steve


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc