fineract-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [fineract] xurror commented on a change in pull request #948: replace iText with openPDF [FINERACT-965]
Date Fri, 29 May 2020 05:24:50 GMT

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



Mime
View raw message