Skip to content

Commit

Permalink
Use InputStream.readAllBytes() in ImageLoader for GTK
Browse files Browse the repository at this point in the history
  • Loading branch information
HannesWell authored and akurtakov committed Dec 18, 2024
1 parent e4a4d28 commit 5db1843
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,7 @@ boolean isInterlacedPNG(byte [] imageAsByteArray) {
List<ImageData> imgDataList = new ArrayList<>();
try {
// 1) Load InputStream into byte array
ByteArrayOutputStream baos = new ByteArrayOutputStream();
stream.transferTo(baos);
baos.flush();
byte[] data_buffer = baos.toByteArray();
byte[] data_buffer = stream.readAllBytes();
if (data_buffer.length == 0) SWT.error(SWT.ERROR_UNSUPPORTED_FORMAT); // empty stream

// 2) Copy byte array to C memory, write to GdkPixbufLoader
Expand Down

0 comments on commit 5db1843

Please sign in to comment.