Foren

Primefaces ImageCropper and FileUpload

Odysseas Doumas, geändert vor 7 Jahren.

Primefaces ImageCropper and FileUpload

New Member Beiträge: 17 Beitrittsdatum: 22.06.16 Neueste Beiträge
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, geändert vor 7 Jahren.

RE: Primefaces ImageCropper and FileUpload

Liferay Master Beiträge: 760 Beitrittsdatum: 14.01.13 Neueste Beiträge
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, geändert vor 7 Jahren.

RE: Primefaces ImageCropper and FileUpload

New Member Beiträge: 17 Beitrittsdatum: 22.06.16 Neueste Beiträge
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, geändert vor 7 Jahren.

RE: Primefaces ImageCropper and FileUpload

Liferay Master Beiträge: 760 Beitrittsdatum: 14.01.13 Neueste Beiträge
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