You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by GitBox <gi...@apache.org> on 2020/05/29 05:24:50 UTC

[GitHub] [fineract] xurror commented on a change in pull request #948: replace iText with openPDF [FINERACT-965]

xurror commented on a change in pull request #948:
URL: https://github.com/apache/fineract/pull/948#discussion_r432261788



##########
File path: fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/ImagesApiResource.java
##########
@@ -140,7 +140,8 @@ public Response retrieveImage(@PathParam("entity") final String entityName, @Pat
             imageDataURISuffix = ContentRepositoryUtils.ImageDataURIsuffix.PNG.getValue();
         }
 
-        final String clientImageAsBase64Text = imageDataURISuffix + Base64.encodeBytes(imageData.getContentOfSize(maxWidth, maxHeight));
+        byte[] resizedImage = imageData.getContentOfSize(maxWidth, maxHeight);
+        final String clientImageAsBase64Text = imageDataURISuffix + Base64.getEncoder().encode(resizedImage);

Review comment:
       ```suggestion
           final String clientImageAsBase64Text = imageDataURISuffix + Base64.getEncoder().encodeToString(resizedImage);
   ```
   
   I suggest you use this instead. Check this for reference: https://www.baeldung.com/java-base64-encode-and-decode.
   Should be able to merge this once that is done.
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org