<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic JPEG Image Resizing and creating a Thumbnail in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/jpeg-image-resizing-and-creating-a-thumbnail/m-p/5735#M2812</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi friend,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am very new to alfresco and i am required to write an api to JPEG to PNG and JPEG to JPEG.&lt;/P&gt;&lt;P&gt;My requirements are as below,&lt;/P&gt;&lt;P&gt;1. take a JPEG image from a folder in alfresco&lt;BR /&gt;2. convert it to PNG type and &amp;nbsp;resize it to different sizes and create thumbnails&lt;/P&gt;&lt;P&gt;3. resize the original JPEG image in folder &amp;nbsp;to different sizes and create thumbnail of small and big size.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using alfresco SDK 2.2.0&lt;/P&gt;&lt;P&gt;I dont know the correct approach and i need to do it within 2 days,&lt;/P&gt;&lt;P&gt;I am trying like below :&amp;nbsp;&lt;/P&gt;&lt;P&gt;currently i have only one image in articles folder in company home&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=================================================================================&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I have made changes in&amp;nbsp;&lt;STRONG&gt;alfresco-global.properties&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ooo.exe=C:/ALFRES~1/LIBREO~1/App/libreoffice/program/soffice.exe&lt;BR /&gt;ooo.enabled=false&lt;BR /&gt;ooo.port=8100&lt;BR /&gt;img.root=C:\\alfresco-one\\imagemagick&lt;BR /&gt;img.coders=${img.root}\\modules\\coders&lt;BR /&gt;img.config=${img.root}&lt;BR /&gt;img.gslib=${img.root}\\lib&lt;BR /&gt;img.exe=${img.root}\\convert.exe&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;==================================================================================&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ArticleImageTransformation.java&lt;BR /&gt;==================================================================================&lt;/STRONG&gt;&lt;BR /&gt; // Getting the target image&lt;BR /&gt; NodeRef arNode = myAlfUtil.getNodeRefByFolderNameInCompanyHome("articles");&lt;BR /&gt; FileInfo arFileInfo = fileFolderService.getFileInfo(arNode);&lt;BR /&gt; FileInfo targetImage = null;&lt;BR /&gt; for(FileInfo image : fileFolderService.listFiles(hmNode)) {&lt;BR /&gt; targetImage = image;&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; //&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ContentReader imageReader = serviceRegistry.getContentService().getReader(targetImage.getNodeRef(), ContentModel.PROP_CONTENT);&lt;BR /&gt; ContentWriter imageWriter = serviceRegistry.getContentService().getWriter(targetImage.getNodeRef(), ContentModel.PROP_CONTENT, true);&lt;BR /&gt; ImageTransformationOptions transformationOption = new ImageTransformationOptions();&lt;BR /&gt; //-geometry 137x171 -bordercolor "white" -border 1x1 -bordercolor "rgb(0,0,51)" -border 1x1&lt;BR /&gt; //transformationOption.setCommandOptions("-geometry 50x40 -bordercolor white -border 1x1 -border 1x1");&lt;BR /&gt;transformationOption.setCommandOptions("-resize 50%");&lt;BR /&gt; ImageResizeOptions imageResizeOptions = new ImageResizeOptions();&lt;BR /&gt; imageResizeOptions.setMaintainAspectRatio(true);&lt;BR /&gt; imageResizeOptions.setHeight(100);&lt;BR /&gt; imageResizeOptions.setWidth(80);&lt;BR /&gt; transformationOption.setResizeOptions(imageResizeOptions);&lt;BR /&gt; transformationOption.setSourceNodeRef(targetImage.getNodeRef());&lt;BR /&gt; transformationOption.setTargetNodeRef(targetImage.getNodeRef());&lt;BR /&gt; &lt;BR /&gt; ContentTransformer imageTransformer = serviceRegistry.getContentService().getTransformer(MimetypeMap.MIMETYPE_IMAGE_JPEG, MimetypeMap.MIMETYPE_IMAGE_JPEG, transformationOption);&lt;BR /&gt; imageTransformer.transform(imageReader, imageWriter);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=======================================================================================&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this is not working.&lt;BR /&gt;Any suggestion, help will be highly appreciated,&lt;BR /&gt; Please help me, it is like do or die problem for me.&lt;/P&gt;&lt;P&gt;Please forgive me for my English.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Apr 2017 07:12:09 GMT</pubDate>
    <dc:creator>amitkumar75</dc:creator>
    <dc:date>2017-04-17T07:12:09Z</dc:date>
    <item>
      <title>JPEG Image Resizing and creating a Thumbnail</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/jpeg-image-resizing-and-creating-a-thumbnail/m-p/5735#M2812</link>
      <description>Hi friend,I am very new to alfresco and i am required to write an api to JPEG to PNG and JPEG to JPEG.My requirements are as below,1. take a JPEG image from a folder in alfresco2. convert it to PNG type and &amp;nbsp;resize it to different sizes and create thumbnails3. resize the original JPEG image in folde</description>
      <pubDate>Mon, 17 Apr 2017 07:12:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/jpeg-image-resizing-and-creating-a-thumbnail/m-p/5735#M2812</guid>
      <dc:creator>amitkumar75</dc:creator>
      <dc:date>2017-04-17T07:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: JPEG Image Resizing and creating a Thumbnail</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/jpeg-image-resizing-and-creating-a-thumbnail/m-p/5736#M2813</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is really sad to know that i am not getting any help,&lt;BR /&gt;Please help me... i am doing other approaches but no success....&lt;BR /&gt;&lt;BR /&gt;At least please guide me where to start, any little guidance will be highly appreciated.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Amit.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 May 2017 06:46:42 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/jpeg-image-resizing-and-creating-a-thumbnail/m-p/5736#M2813</guid>
      <dc:creator>amitkumar75</dc:creator>
      <dc:date>2017-05-16T06:46:42Z</dc:date>
    </item>
  </channel>
</rss>

