Foros de discusión

Primefaces ImageCropper and FileUpload

Odysseas Doumas, modificado hace 7 años.

Primefaces ImageCropper and FileUpload

New Member Mensajes: 17 Fecha de incorporación: 22/06/16 Mensajes recientes
I need to implement a custom portlet using primefaces where someone can upload an image, crop it and then save it.

For the upload part i save the (temporary) image using TempFileUtil.

fileEntry = TempFileUtil.addTempFile(groupId, userId, fileName, tempFolderName, inputStream, mimeType);


Can someone explain to me what value should i use inside the "image" attribute of the primefaces ImageCropper . I tried using :

String previewURL = DLUtil.getPreviewURL(fileEntry, fileVersion, 
						themeDisplay, queryString, appendVersion, absoluteURL);
but of course it didn't work. i can succesfully use this URL to view my image, but ImageCropper always returns a java null error. Has someone else used ImageCropper to give me a hint?
thumbnail
Kyle Joseph Stiemann, modificado hace 7 años.

RE: Primefaces ImageCropper and FileUpload

Liferay Master Mensajes: 760 Fecha de incorporación: 14/01/13 Mensajes recientes
Hi Odysseas,
Which version of Primefaces are you using? p:imageCropper was broken in portlets until PrimeFaces 6.0 due to Primefaces Issue 1248.

- Kyle
Odysseas Doumas, modificado hace 7 años.

RE: Primefaces ImageCropper and FileUpload

New Member Mensajes: 17 Fecha de incorporación: 22/06/16 Mensajes recientes
Kyle Joseph Stiemann:
Hi Odysseas,
Which version of Primefaces are you using? p:imageCropper was broken in portlets until PrimeFaces 6.0 due to Primefaces Issue 1248.

- Kyle

First of all, thank you for the quick response.

I am sorry for wasting your time, i didn't correctly set the initial coordinates which resulted to a null exception. Feel free to delete this thread.
thumbnail
Kyle Joseph Stiemann, modificado hace 7 años.

RE: Primefaces ImageCropper and FileUpload

Liferay Master Mensajes: 760 Fecha de incorporación: 14/01/13 Mensajes recientes
No time wasted emoticon Thanks for posting your solution! Perhaps it will help other p:imageCropper users if they see a similar error.

Thanks for using Liferay Faces!

- Kyle