Fórum
Thumbnails
Sameer Shaik, modificado 11 Anos atrás.
Thumbnails
New Member Postagens: 19 Data de Entrada: 02/08/12 Postagens Recentes
How to convert an image into a thumbnail in liferay ?
Tejas Kanani, modificado 11 Anos atrás.
RE: Thumbnails
Liferay Master Postagens: 654 Data de Entrada: 06/01/09 Postagens Recentes
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
And if you want its thumbnail image then you can use below url
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).
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).
Sameer Shaik, modificado 11 Anos atrás.
RE: Thumbnails
New Member Postagens: 19 Data de Entrada: 02/08/12 Postagens Recentes
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.
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.
Tejas Kanani, modificado 11 Anos atrás.
RE: Thumbnails
Liferay Master Postagens: 654 Data de Entrada: 06/01/09 Postagens Recentes
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.
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.
Sameer Shaik, modificado 11 Anos atrás.
RE: Thumbnails
New Member Postagens: 19 Data de Entrada: 02/08/12 Postagens Recentes
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.
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.
Anexos:
Tejas Kanani, modificado 11 Anos atrás.
RE: Thumbnails
Liferay Master Postagens: 654 Data de Entrada: 06/01/09 Postagens Recentes
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.
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.
Sameer Shaik, modificado 11 Anos atrás.
RE: Thumbnails
New Member Postagens: 19 Data de Entrada: 02/08/12 Postagens Recentes
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,
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,
Tejas Kanani, modificado 11 Anos atrás.
RE: Thumbnails
Liferay Master Postagens: 654 Data de Entrada: 06/01/09 Postagens Recentes
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.
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.
Sameer Shaik, modificado 11 Anos atrás.
RE: Thumbnails
New Member Postagens: 19 Data de Entrada: 02/08/12 Postagens Recentes
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);
}
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);
}
santhosh mp, modificado 8 Anos atrás.
RE: Thumbnails
New Member Mensagem: 1 Data de Entrada: 12/08/15 Postagens Recentes
Im facing the same issue plz reply
Alberto Chaparro, modificado 8 Anos atrás.
RE: Thumbnails
Liferay Master Postagens: 549 Data de Entrada: 25/04/11 Postagens Recentes
Hi Sammer,
If your purpose is to generate thumbnails programmatically you can use the following method:
If not, please describe better your problem.
Regards.
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.
Hitoshi Ozawa, modificado 11 Anos atrás.
RE: Thumbnails
Liferay Legend Postagens: 7942 Data de Entrada: 24/03/10 Postagens Recentes
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.
Open a web browser and paste the url with the &imageThumbnail=1 appended. It should show the image as a thumbnail.
Sameer Shaik, modificado 11 Anos atrás.
RE: Thumbnails
New Member Postagens: 19 Data de Entrada: 02/08/12 Postagens Recentes
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 .
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 .
Hitoshi Ozawa, modificado 11 Anos atrás.
RE: Thumbnails
Liferay Legend Postagens: 7942 Data de Entrada: 24/03/10 Postagens Recentes
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?
Is the image in the Document & Media folder? If not, where is the image file?
Sameer Shaik, modificado 11 Anos atrás.
RE: Thumbnails
New Member Postagens: 19 Data de Entrada: 02/08/12 Postagens Recentes
hi Hitoshi,
Yeah image is present in Document & media only,pls see the screen shot which i have posted now...
Yeah image is present in Document & media only,pls see the screen shot which i have posted now...
Vijay Gohil, modificado 11 Anos atrás.
RE: Thumbnails
New Member Postagens: 16 Data de Entrada: 29/06/10 Postagens Recentes
Hi Sameer,
Please try below method which creates thumbnail image from normal image
IGImage igImage = IGImageLocalServiceUtil.getImageByUuidAndGroupId(uuId, groupId);
Please try below method which creates thumbnail image from normal image
IGImage igImage = IGImageLocalServiceUtil.getImageByUuidAndGroupId(uuId, groupId);
Sameer Shaik, modificado 11 Anos atrás.
RE: Thumbnails
New Member Postagens: 19 Data de Entrada: 02/08/12 Postagens Recentes
hi vijay,
"IGImageLocalServiceUtil" is not working in liferay 6.1
"IGImageLocalServiceUtil" is not working in liferay 6.1