image handling (thumbnails)

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

image handling (thumbnails)

Tiarnán Ó Corráin
Hi--

what's the recommended / popular way of doing basic image handling in Seaside?  My requirements are to take uploaded images and make thumbnails in a few different sizes.  I see some references so SMagick and to Smalltalk-local image handling around, but I'm wondering what general practice is among posters on this list.

thanks

Tiarnán

--
The law, in its majestic equality, forbids the rich as well as the poor to sleep under bridges, to beg in the streets, and to steal bread -- Anatole France

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: image handling (thumbnails)

fstephany
Smagick works well but beware that it blocks the VM when processing an
image.

For Wapict (images are sometimes ~50mb), I simply have an external queue
with workers using OSProcess to convert images. Not terribly efficient
but works well enough.

To generate thumbnails of, say, profile pictures on a website, I don't
really know what I would use. Have you found any pure-smalltalk image
manipulation library?



On 25/09/12 08:42, Tiarnán Ó Corráin wrote:

> Hi--
>
> what's the recommended / popular way of doing basic image handling in
> Seaside?  My requirements are to take uploaded images and make
> thumbnails in a few different sizes.  I see some references so SMagick
> and to Smalltalk-local image handling around, but I'm wondering what
> general practice is among posters on this list.
>
> thanks
>
> Tiarnán
>
> --
> The law, in its majestic equality, forbids the rich as well as the poor
> to sleep under bridges, to beg in the streets, and to steal bread --
> Anatole France
>
>
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>

--
http://tulipemoutarde.be
CA: +1 778 558 3225
BE: +32 65 709 131
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: image handling (thumbnails)

Tiarnán Ó Corráin
Hi--

that sounds very interesting.  Could you post some example code, or even a skeleton?

thanks

Tiarnán

On Tue, Sep 25, 2012 at 6:20 PM, Francois Stephany <[hidden email]> wrote:
Smagick works well but beware that it blocks the VM when processing an image.

For Wapict (images are sometimes ~50mb), I simply have an external queue with workers using OSProcess to convert images. Not terribly efficient but works well enough.

To generate thumbnails of, say, profile pictures on a website, I don't really know what I would use. Have you found any pure-smalltalk image manipulation library?




On 25/09/12 08:42, Tiarnán Ó Corráin wrote:
Hi--

what's the recommended / popular way of doing basic image handling in
Seaside?  My requirements are to take uploaded images and make
thumbnails in a few different sizes.  I see some references so SMagick
and to Smalltalk-local image handling around, but I'm wondering what
general practice is among posters on this list.

thanks

Tiarnán

--
The law, in its majestic equality, forbids the rich as well as the poor
to sleep under bridges, to beg in the streets, and to steal bread --
Anatole France


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


--
http://tulipemoutarde.be
CA: <a href="tel:%2B1%20778%20558%203225" value="+17785583225" target="_blank">+1 778 558 3225
BE: <a href="tel:%2B32%2065%20709%20131" value="+3265709131" target="_blank">+32 65 709 131
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



--
The law, in its majestic equality, forbids the rich as well as the poor to sleep under bridges, to beg in the streets, and to steal bread -- Anatole France

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: image handling (thumbnails)

fstephany
My OSProcess call is pretty stupid actually. It's something along the line:

env := OSProcess thisOSProcess environment copy.
path := (env at: #PATH), ':/usr/local/bin/:/usr/bin/'.
env at: #PATH put: path.

pipe := (PipeableOSProcess command: command environment: env).
pipe output.
pipe closePipes.


where the command is the imagemagick command as you would use it from
the command line.

I think SMagick does the same kind of thing but have a nice Smalltalk
wrapper around.



On 25/09/12 11:39, Tiarnán Ó Corráin wrote:

> Hi--
>
> that sounds very interesting.  Could you post some example code, or even
> a skeleton?
>
> thanks
>
> Tiarnán
>
> On Tue, Sep 25, 2012 at 6:20 PM, Francois Stephany
> <[hidden email] <mailto:[hidden email]>> wrote:
>
>     Smagick works well but beware that it blocks the VM when processing
>     an image.
>
>     For Wapict (images are sometimes ~50mb), I simply have an external
>     queue with workers using OSProcess to convert images. Not terribly
>     efficient but works well enough.
>
>     To generate thumbnails of, say, profile pictures on a website, I
>     don't really know what I would use. Have you found any
>     pure-smalltalk image manipulation library?
>
>
>
>
>     On 25/09/12 08:42, Tiarnán Ó Corráin wrote:
>
>         Hi--
>
>         what's the recommended / popular way of doing basic image
>         handling in
>         Seaside?  My requirements are to take uploaded images and make
>         thumbnails in a few different sizes.  I see some references so
>         SMagick
>         and to Smalltalk-local image handling around, but I'm wondering what
>         general practice is among posters on this list.
>
>         thanks
>
>         Tiarnán
>
>         --
>         The law, in its majestic equality, forbids the rich as well as
>         the poor
>         to sleep under bridges, to beg in the streets, and to steal bread --
>         Anatole France
>
>
>         _________________________________________________
>         seaside mailing list
>         [hidden email]
>         <mailto:[hidden email]>
>         http://lists.squeakfoundation.__org/cgi-bin/mailman/listinfo/__seaside
>         <http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside>
>
>
>     --
>     http://tulipemoutarde.be
>     CA: +1 778 558 3225 <tel:%2B1%20778%20558%203225>
>     BE: +32 65 709 131 <tel:%2B32%2065%20709%20131>
>     _________________________________________________
>     seaside mailing list
>     [hidden email]
>     <mailto:[hidden email]>
>     http://lists.squeakfoundation.__org/cgi-bin/mailman/listinfo/__seaside
>     <http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside>
>
>
>
>
> --
> The law, in its majestic equality, forbids the rich as well as the poor
> to sleep under bridges, to beg in the streets, and to steal bread --
> Anatole France
>
>
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>

--
http://tulipemoutarde.be
CA: +1 778 558 3225
BE: +32 65 709 131
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: image handling (thumbnails)

Robert Sirois
In reply to this post by Tiarnán Ó Corráin
Here's some random code I have from an unfinished project a couple years ago. Not sure how useful it is.

" accepts PNGs only "
(picture isNil not) ifTrue: [

aForm := (PNGReadWriter createAFormFrom: picture contents) first.
" create avatar and save under name avatarBlahblahPng "
thumbnail := PNGReadWriter on: (RWBinaryOrTextStream on: '').
thumbnail nextPutImage: (aForm scaledToSize: (Point x: 75 y: 75)).
UGFileLibrary addFileNamed: 'avatar', user username, 'Png' contents: thumbnail contents.

RS


Date: Tue, 25 Sep 2012 19:39:27 +0100
Subject: Re: [Seaside] image handling (thumbnails)
From: [hidden email]
To: [hidden email]

Hi--

that sounds very interesting.  Could you post some example code, or even a skeleton?

thanks

Tiarnán

On Tue, Sep 25, 2012 at 6:20 PM, Francois Stephany <[hidden email]> wrote:
Smagick works well but beware that it blocks the VM when processing an image.

For Wapict (images are sometimes ~50mb), I simply have an external queue with workers using OSProcess to convert images. Not terribly efficient but works well enough.

To generate thumbnails of, say, profile pictures on a website, I don't really know what I would use. Have you found any pure-smalltalk image manipulation library?




On 25/09/12 08:42, Tiarnán Ó Corráin wrote:
Hi--

what's the recommended / popular way of doing basic image handling in
Seaside?  My requirements are to take uploaded images and make
thumbnails in a few different sizes.  I see some references so SMagick
and to Smalltalk-local image handling around, but I'm wondering what
general practice is among posters on this list.

thanks

Tiarnán

--
The law, in its majestic equality, forbids the rich as well as the poor
to sleep under bridges, to beg in the streets, and to steal bread --
Anatole France


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


--
http://tulipemoutarde.be
CA: +1 778 558 3225
BE: +32 65 709 131
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



--
The law, in its majestic equality, forbids the rich as well as the poor to sleep under bridges, to beg in the streets, and to steal bread -- Anatole France

_______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: image handling (thumbnails)

Tiarnán Ó Corráin
Hi--

thanks to Robert and Francois for the excellent tips.  I have a working solution now.  Looks like Pharo's image handling capabilities are sufficient for my purposes.  

regards

Tiarnán


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: image handling (thumbnails)

fstephany
This might interests you:
http://articles.tulipemoutarde.be/seaside-wrapper-for-filepickerio

If you upload images, Filepicker.io have a nice way to get them
resized/watermarked/whatever. It is not in my wrapper (yet) but I can
add it if you need...

Francois

On 26/09/12 06:05, Tiarnán Ó Corráin wrote:

> Hi--
>
> thanks to Robert and Francois for the excellent tips.  I have a working
> solution now.  Looks like Pharo's image handling capabilities are
> sufficient for my purposes.
>
> regards
>
> Tiarnán
>
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside