Re: Resizing images using imgscalr

2014-09-24 Thread Sandor Szatmari
Yes, I would second my own recommendation for using JAI.  It works great for 
this.  I store large TIFF images in Postgres as blobs and scale them on the fly 
based on the HTTP request params.  I have fixed sizes, like thumbnail, and 
info, but also support support arbitrary sizes.  Only specify x, or y and the 
scaling is proportional.

Sandor Szatmari

 On Sep 24, 2014, at 09:31, Thorsten Scherler thors...@apache.org wrote:
 
 On 18/09/14 15:43, Peter Sparkes wrote:
 Hi,
 
 Cocoon 2.1.12
 
  I use the following javascript ( Text in Black )with the Cocoon Upload 
 widget uploading images to the upload-dir and then move them to the 
 lodgeimage300px directory. This works
 
 I now want to scale the images using imgscalr , 
 http://www.thebuzzmedia.com/software/imgscalr-java-image-scaling-library/#source
 
 I, therefore, added the code in red
 
 The BufferedImage   in BufferedImage scaledImage =Scalr.resize(file, 200); 
 gave me a syntax error.
 
 On removing  BufferedImage   I get the following error Scalr is not defined
 
 Can anyone help me Please
 
 Peter
 
 importClass(Packages.java.io.File);
 importClass(Packages.java.io.FileOutputStream);
 importClass(Packages.java.io.FileNotFoundException);
 
 importClass(org.imgscalr.Scalr);
 
 This does not have the importClass(Packages. prefix that explains why later 
 this class is not defiened. However I personally would solve that with java.
 
 salu2
 -- 
 Thorsten Scherler thorsten.at.apache.org
 codeBusters S.L. - web based systems
 consulting, training and solutions
 http://www.codebusters.es/


Re: Resize images

2014-09-11 Thread Sandor Szatmari
I use JAI to dynamically resize images for my site.  There are lot of examples 
if you google 'JAI image resize'.  I store higher res images and downscale them 
on the fly to the right size for the context they will be used in.  I wrote a 
plain old servlet to do it, but I'm sure it could be done in cocoon too.

Sandor

 On Sep 11, 2014, at 10:38, Javier Puerto jpue...@gmail.com wrote:
 
 Hi Peter,
 
 If you can use ImageMagick, you can try with: http://im4java.sourceforge.net/
 
 2014-09-11 16:27 GMT+02:00 Edward David eda...@ucalgary.ca:
 Peter,
 There are numerous image resizer programs out there.
 Check out this Free Picture Resizer at  
 http://download.cnet.com/Free-Picture-Resizer/3000-12511_4-10297789.html
 
 
 Thanks,
 ___
 Edward David
 Information Technologies Services,
 Libraries and Cultural Resources,
 The University of Calgary
 Phone: (403) 220-3383
 Fax: (403) 282-1218
 
 -Original Message-
 From: Peter Sparkes [mailto:pe...@didm.co.uk]
 Sent: September-11-14 8:23 AM
 To: users@cocoon.apache.org  Cocoon users
 Subject: Resize images
 
 Hi,
 
 I currently have a cocoon application which enables the site owner to upload 
 images and then  within the upload javascript uses java to move the images 
 to the required directory.
 
 Most of the uploaded images are  large and therefore they are  slow in 
 displaying in a web page.
 
 I, therefore, wish to resize them before saving them.
 
 I am not sure how to do it.
 
 Please, can anyone help
 
 Thanks
 
 Peter
 
 -
 To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
 For additional commands, e-mail: users-h...@cocoon.apache.org
 


Capture or Output data from current flow state to PDF

2014-02-01 Thread Sandor Szatmari
Hello,

Using Cocoon 2.2, I am trying to generate some PDF interactively using flow.  
The flowscript loops, continually getting input from the user, allowing them to 
add content via form submission.  The input is collected and used to 
dynamically build a document.  This part works using the sitemap.xmap below.

What I would like to do next is take the current state of the data collected in 
the flow and transform to PDF.

I'm not sure how to capture the output of the current flow state.

Can this be done at all?
If so, can it be done inside the pipeline without writing to a temporary file?

Using Cocoon 2.2 is not a requirement so if this is achievable with a different 
version that is OK.

?xml version=1.0 encoding=UTF-8?
map:sitemap xmlns:map=http://apache.org/cocoon/sitemap/1.0;

map:flow language=javascript/
   !-- map:script src=flow/game.js/
/map:flow--

map:pipelines

  map:pipeline id=test
map:match pattern=test
  map:call function=main/
/map:match

map:match pattern=*.jx internal-only=true
  map:generate type=jx src=documents/{1}.jx/
  map:serialize type=xhtml/
/map:match

map:match pattern=*.kont
  map:call continuation={1}/
/map:match
  /map:pipeline
/map:pipelines

/map:sitemap

Regards,
Sandor
-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org