Questions tagged [imagedecoder]

A class presented on Android P for decoding image files, including animated images (GIF/WEBP).

A class presented on Android P for decoding image files, including animated images (GIF/WEBP): https://developer.android.com/reference/android/graphics/ImageDecoder

17 questions
21
votes
4 answers

Is it possible to get the new ImageDecoder class to return Bitmaps, one frame after another, manually?

Background I'm trying to go over bitmaps of animated GIF&WEBP files manually (frame by frame), so that it would work not just for Views, but on other cases too (such as a live wallpaper). The problem Animated GIF/WEBP files are supported only from…
android developer
  • 114,585
  • 152
  • 739
  • 1,270
19
votes
0 answers

What's the use and advantages of using ImageDecoder of Android P?

Background Android P presents a new API for loading images, using ImageDecoder class. The problem Not much is documented about this class, so I'm just curious about its usage, and whether I should consider using it when possible, instead of Glide…
android developer
  • 114,585
  • 152
  • 739
  • 1,270
9
votes
0 answers

How to obtain an image size using Android's ImageDecoder class?

Trying to get an image size using the ImageDecoder I can't find any option to get only the size without decoding the image bitmap. With BitmapFactory can be done with: BitmapFactory.Options.inJustDecodeBounds = true This setting makes the decoder…
PerracoLabs
  • 16,449
  • 15
  • 74
  • 127
3
votes
4 answers

How to get mutable bitmap using ImageDecoder?

I am creating bitmap as follows ImageDecoder.Source source = ImageDecoder.createSource(this.getContentResolver(), mSourceUri); try { bitmap = ImageDecoder.decodeBitmap(source)); } catch (IOException e) { …
Mayank Kumar Chaudhari
  • 16,027
  • 10
  • 55
  • 122
2
votes
1 answer

Loading a bitmap with ImageDecoder from URI and adding text

In my activity, I want to modify an image to add a text on it. The image is selected in the galery or taken with the camera and then stored in a file in a previous activity. Then the uri of that file is passed through extras. Now I try to add a…
Sica
  • 79
  • 11
2
votes
1 answer

Image-to-Text Decoder

I would like to decode the following image into text : I already tried to use Tesseract OCR for my purpose but I've not been lucky so far. Here's my code : import pytesseract import sys import argparse try: import Image except ImportError: …
Foussy
  • 287
  • 2
  • 11
1
vote
1 answer

Why Android's ImageDecoder (introduced in Pie) don't has a public InputStreamSource?

Android's new class for decode images, the ImageDecoder, has lots of source types. But not the createSource(InputStream) included. There is a similar method createSource(Resources res, InputStream is), but it is hidden(why?). Now I want to use…
landerlyoung
  • 1,693
  • 17
  • 14
1
vote
2 answers

ImageDecoder vs BitmapFactory

With android Pie a new Class is available to handle bitmap and drawable operation. Previously i used BitmapFactory in my most application to handle bitmap operations. My question is Should i start using ImageDecoder?, how ImageDecoder is better then…
Ashwini Saini
  • 1,324
  • 11
  • 20
0
votes
0 answers

Unexpected image rotation in decoding-encoding process with jpeg-js library

I'm using jpeg-js library to decode an image, apply my own greyscale filter, and encode it back. But unfortunately every vertical picture I process for some reason is rotated and saved horizontally (while horizontal images preserve its correct…
0
votes
1 answer

How can I cancel image decoding in JavaScript?

To transform binary image data (e.g. from a file input) into a canvas image source, createImageBitmap or Image.decode can be used. Is there a cancellable alternative to these methods? I want to render images from a multiple file input to a canvas…
0
votes
0 answers

Android ImageDecoder extremely slow performance with HEIC/HEIF images

I'm using subsampling-scale-image-view to display images, and I implemented function like the Gallery app usually do (allow user to view image, zoom then and swipe left or right to switch between images). I found out that when I swipe to change…
Hhry
  • 823
  • 1
  • 8
  • 19
0
votes
0 answers

webworker and module import from fast-png does not work

I need 16 bit greyscale images because of the detail accuracy for depth information. I use fast-png and am very happy with it. After the import, I only have to use the decode command to get the image information. What confuses me now is that when I…
Spiri
  • 331
  • 2
  • 9
0
votes
2 answers

Decoding a JPEG Huffman Table

I am looking for a way to retrieve the minCode, maxCode and valPtr from an arbitrary Huffman table. For instance, the following is a Huffman DC table generated by JpegSnoop: Destination ID = 0 Class = 0 (DC / Lossless Table) Codes of length 01…
NBG
  • 30
  • 7
0
votes
1 answer

Jetpack Compose - Resizing Image after Image PIcker (ContentResolver Exception?)

I'm just trying to resize an image after the user launches the Image Picker from my app and chooses an image file on the local device (handling a remote image from Dropbox or something will be another battle) and while this has worked for me…
clamum
  • 1,237
  • 10
  • 18
0
votes
1 answer

Android NDK ImageDecoder functions requires build error

I'm trying to get byte data of png file for GLES texture. I have my png file in app\source\main\assets. Texture::Texture(const char *path) { AAsset* asset = loadAsset(path); AImageDecoder* decoder; int result =…
이재원
  • 69
  • 1
  • 9
1
2