掲示板

Thumbnails

11年前 に Sameer Shaik によって更新されました。

Thumbnails

New Member 投稿: 19 参加年月日: 12/08/02 最新の投稿
How to convert an image into a thumbnail in liferay ?
thumbnail
11年前 に Tejas Kanani によって更新されました。

RE: Thumbnails

Liferay Master 投稿: 654 参加年月日: 09/01/06 最新の投稿
Hi Sameer,

Not sure this will help you or not. But in Liferay if your image uploaded in Documents & Media portlet and lets say its url is
http://localhost:8080/documents/10703/0/Tejas/0fb48caa-7be4-48bf-a2cd-38dc23ef6a79?version=1.0&t=1344161777109

And if you want its thumbnail image then you can use below url
http://localhost:8080/documents/10703/0/Tejas/0fb48caa-7be4-48bf-a2cd-38dc23ef6a79?version=1.0&t=1344161777109&imageThumbnail=1

Only difference in second url is imageThumbnail=1 parameter.
So you can add imageThumbnail=1 to display thumbnail of your image(If its uploaded in Documents & Media portlet).
11年前 に Sameer Shaik によって更新されました。

RE: Thumbnails

New Member 投稿: 19 参加年月日: 12/08/02 最新の投稿
Hi Tejas,

Thanks for your reply..

I have tried your code but still i am unable to get the thumbnail,and moreover my images are present in document library,and i am using liferay 6.1.
thumbnail
11年前 に Tejas Kanani によって更新されました。

RE: Thumbnails

Liferay Master 投稿: 654 参加年月日: 09/01/06 最新の投稿
You can check the same in Document & Media portlet thumbnail view only.
Just go to Control Panel --> Documents & Media --> Your Image in folder view
Here you'll find all your image's thumbnails. And if you check its url using Firebug or in html source.
You'll find similar url which I've suggested. So you can take reference of this. And please also find attached snap.

So verify if you are getting your uploaded image's thumbnail in Documents & Media portlet ? If yes then it take its url and it will work for you anywhere.
11年前 に Sameer Shaik によって更新されました。

RE: Thumbnails

New Member 投稿: 19 参加年月日: 12/08/02 最新の投稿
hi Tejas

Thanks for the reply..

I am able to display thumbnail but ,image is not getting displayed inside thumbnail..pls check the following screenshot once..i have rounded the thumbnail part with red circle..pls check it.

添付ファイル:

thumbnail
11年前 に Tejas Kanani によって更新されました。

RE: Thumbnails

Liferay Master 投稿: 654 参加年月日: 09/01/06 最新の投稿
What is the url for your thumbnail ?
Check whether are you getting the thumbnail for same image in Documents & Media portlet.
If yes, compare the url of yours and Document & Media portlet's.
11年前 に Sameer Shaik によって更新されました。

RE: Thumbnails

New Member 投稿: 19 参加年月日: 12/08/02 最新の投稿
Hi tejas

I have uploaded an image directly into Document & media like(Add >Basic Document) and in this way i am able to get the thumbnail,but actually my requirement is i need to
insert image through an action class into document library,and i have inserted through an action class also,but i am unable to get the thumbnail in this way moreover my image is getting stored like this,see the following screenshot,
thumbnail
11年前 に Tejas Kanani によって更新されました。

RE: Thumbnails

Liferay Master 投稿: 654 参加年月日: 09/01/06 最新の投稿
Hi Sameer,
Can you please share the code which you've wrote using Liferay API to store the image in Documents & Media ? Looks like its not even displaying thumbnail in Document & Media portlet.
11年前 に Sameer Shaik によって更新されました。

RE: Thumbnails

New Member 投稿: 19 参加年月日: 12/08/02 最新の投稿
hi tejas,



public void uploadImage(ActionRequest actionRequest,
ActionResponse actionResponse,File file) throws Exception {

ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest
.getAttribute("THEME_DISPLAY");

String folderName = "UPLOADED_IMAGES";
long groupId = themeDisplay.getScopeGroupId();;


long userId = themeDisplay.getUserId();
long companyId = themeDisplay.getCompanyId();





UploadPortletRequest uploadPortletRequest = PortalUtil
.getUploadPortletRequest(actionRequest);


System.out.println("from uploaded"+file);
InputStream inputStream = uploadPortletRequest.getFileAsStream("addimage");

String fileName =FileUtil.getShortFileName(file.getName());



String as=themeDisplay.getPathContext();
System.out.println("from uploaded images"+ fileName);
System.out.println(as);

String contentType = uploadPortletRequest.getContentType();

long folderId = 0l;
long repositoryId = DLFolderConstants.getDataRepositoryId(themeDisplay.getScopeGroupId(),DLFolderConstants.DEFAULT_PARENT_FOLDER_ID);


ServiceContext serviceContext = new ServiceContext();
serviceContext.setAddGroupPermissions(true);
serviceContext.setAddGuestPermissions(true);
serviceContext.setScopeGroupId(groupId);
serviceContext.setCompanyId(companyId);

DLFolder dlFolder = null;
try {

dlFolder = DLFolderLocalServiceUtil.getFolder(groupId,DLFolderConstants.DEFAULT_PARENT_FOLDER_ID, folderName);

} catch (Exception dde) {


dlFolder = DLFolderLocalServiceUtil.addFolder(userId, groupId,
repositoryId, false, 0l, folderName, folderName,
serviceContext);
}


DLAppLocalServiceUtil.addFileEntry(userId, repositoryId, folderId,
fileName, contentType, fileName, fileName, null, file,
serviceContext);


}
8年前 に santhosh mp によって更新されました。

RE: Thumbnails

New Member 投稿: 1 参加年月日: 15/08/12 最新の投稿
Im facing the same issue plz reply
thumbnail
8年前 に Alberto Chaparro によって更新されました。

RE: Thumbnails

Liferay Master 投稿: 549 参加年月日: 11/04/25 最新の投稿
Hi Sammer,

If your purpose is to generate thumbnails programmatically you can use the following method:
com.liferay.portlet.documentlibrary.util.ImageProcessorUtil.generateImages(null, FileVersion destinationFileVersion)


If not, please describe better your problem.

Regards.
thumbnail
11年前 に Hitoshi Ozawa によって更新されました。

RE: Thumbnails

Liferay Legend 投稿: 7942 参加年月日: 10/03/24 最新の投稿
Just open up your document and media portlet and select "URL" link. Copy the URL that shows up and just append "&imageThumbnail=1" to the end of the url.
Open a web browser and paste the url with the &imageThumbnail=1 appended. It should show the image as a thumbnail.
11年前 に Sameer Shaik によって更新されました。

RE: Thumbnails

New Member 投稿: 19 参加年月日: 12/08/02 最新の投稿
hi hitoshi



Thanks for the reply...

pls check the screen shot which i have posted in this page because i am able to get the thumbnail,but image is not getting displayed .
thumbnail
11年前 に Hitoshi Ozawa によって更新されました。

RE: Thumbnails

Liferay Legend 投稿: 7942 参加年月日: 10/03/24 最新の投稿
So your problem is not being able to show thumbnails but that you can not display image.
Is the image in the Document & Media folder? If not, where is the image file?
11年前 に Sameer Shaik によって更新されました。

RE: Thumbnails

New Member 投稿: 19 参加年月日: 12/08/02 最新の投稿
hi Hitoshi,

Yeah image is present in Document & media only,pls see the screen shot which i have posted now...
thumbnail
11年前 に Vijay Gohil によって更新されました。

RE: Thumbnails

New Member 投稿: 16 参加年月日: 10/06/29 最新の投稿
Hi Sameer,

Please try below method which creates thumbnail image from normal image

IGImage igImage = IGImageLocalServiceUtil.getImageByUuidAndGroupId(uuId, groupId);
11年前 に Sameer Shaik によって更新されました。

RE: Thumbnails

New Member 投稿: 19 参加年月日: 12/08/02 最新の投稿
hi vijay,

"IGImageLocalServiceUtil" is not working in liferay 6.1