Open javading opened 2 years ago
My main code is as follows:
`
HEIF heif = new HEIF(); heif.load("/root/1.heic"); ImageItem primaryImage = heif.getPrimaryImage(); List<byte[]> imageSequenceSampleDatas = new ArrayList<>(); if (primaryImage instanceof GridImageItem) { GridImageItem gridImageItem = (GridImageItem) primaryImage; // Go through the grid for (int rowIndex = 0; rowIndex < gridImageItem.getRowCount(); rowIndex++) { for (int columnIndex = 0; columnIndex < gridImageItem.getColumnCount(); columnIndex++) { // We assume that the image items are HEVC HEVCImageItem hevcImageItem = (HEVCImageItem) gridImageItem.getImage(columnIndex, rowIndex); // byte[] decoderConfig = hevcImageItem.getDecoderConfig().getConfig(); byte[] imageData1 = hevcImageItem.getItemDataAsArray(); JPEGDecoderConfig decoderConfig = new JPEGDecoderConfig(newHeif, decoderConfigData); JPEGImageItem jpegImageItem = new JPEGImageItem(newHeif, new Size(width, height), decoderConfig, imageData1); newHeif.setPrimaryImage(jpegImageItem); newHeif.setMajorBrand(HEIF.BRAND_JPEG); newHeif.addCompatibleBrand(HEIF.BRAND_JPEG); newHeif.save("/root/1-1.jpg"); } } }`
My main code is as follows:
`