Difference between flutter camera and flutter image_picker XFiles base64 encoding - flutter

When i take a picture from the CameraController in camera package, and i take the same picture with the same image but with image_picker, and i encode every picture to base64 code, both codes are completely different. 3/4 (800) of their characteres are different. But, when i take two different pictures to the same object with just image_picker, and i compare the base64 codes of erveyone, they are almost the same, just with 6-7 different characteres. I tested visually showing the image files generated by image_picture and camera and they are basically the same.
That's a problem to me, because tesseract package recognize the images from image_picker, but not the images from camera, so, i need to know what is the root of the problem and if that have any solution.

Related

How to convert a List<Uint8list> to GIF?

How to convert List<Uint8List> to an animated GIF?
my List<Uint8List> consists of images and I need to merge them and make them as GIF.
I've tried this but it does not animate:
Is their any way to convert .jpeg images to .gif in flutter?
The link you provided should work. If not, please give a reproducible sample. For example, provide your sample List<Uint8List>. In addition, what error messages do you see?
Without further information, I guess your Uint8List is not of the correct format. If you upload one example Uint8List (you know, just some bytes), I can have a look.
By the way, I suggest to have some basic understanding of image formats. For example, what is a "bitmap" (pixels are arranged byte by byte), and what is a encoded format like jpeg/png/gif/etc.
I think the best thing is that you develop the gif in any program for this and then load it with your app from the assets, if you need help tell me and I can help you better by sending me the images to make the gif

Thumbnailator conversion from PNG to JPG results in all-white image

For many images, this code works fine to convert a PNG image to JPG:
Thumbnails.of(pngIn)
.outputFormat("jpg")
.scale(1.0)
.toFile(jpgOut);
But for this specific image:
the code results in an all-white JPG image. If someone can point me to the right way of doing things in Thumbnailator, I would very much appreciate it. Cheers!
EDIT: Well, something in the image upload / download process makes things work for the attached image! (The downloaded image is 50K while the original image is 41K, so clearly there's some funkiness going on there.) But I promise that the original PNG really does not work.
EDIT 2: This link to Google images can be used to download the 920x900 PNGWing image (41K) on the right side of the page.
The above syntax seems to be correct for converting PNG to JPG. The problem is that when the referenced image is read into a BufferedImage object, the image's type is BufferedImage.TYPE_BYTE_BINARY. While such images can be 1, 2, or 4-bit images, Thumbnailator doesn't handle 2- or 4-bit images correctly, essentially assuming that the image is a 1-bit image.
In short: the syntax is correct, but there appears to be a Thumbnailator bug that hinders successful processing of some PNG files.

How to do FirebaseVisionImage.fromBytes(bytes, metadata) from firebase_vision_image package of flutter

Hi I am using firebase_vision_image package of flutter and right now I do confused, is there a way to change FirebaseVisionImage.fromFile(myImage file) to FirebaseVisionImage.fromBytes(bytes, metadata)? I have used FirebaseVisionImage.fromFile(myImage file) and myImage here is an image taking from camera but I always get slow respond when image processing.. so here I want to try to convert myImage to bytes,metadata and I would like to see the differences for both of them or maybe is there a better way to speed the image processing up when image come from camera taking

Where does image_picker store images?

This is just a general question as to how the image_picker plugin works. When I select an image from the device gallery, the path is something like this: "tmp/image_picker.jpg". This is obviously not the original path of the image on the device. Does image_picker make a copy of the image? If so, where is it stored? Is it stored in the app data?
Maybe someone could point me to a white paper that explains all of this.
When I take a picture using the camera and image_picker the filename has the similar tmp path. The image can be reloaded by my app, but the image is not available in the device gallery. I understand that there are plugins to save the image to the gallery, but I would like to know how to delete the extra images from the tmp folder.
You can check this screenshot & link.
Note: Images and videos picked using the camera are saved to your application's local cache, and should therefore be expected to only be
around temporarily. If you require your picked image to be stored
permanently, it is your responsibility to move it to a more permanent
location.
Also same for gallery images because every time file_path will different because the library will store image in cache / temporary storage.

AlamofireImage: Is it possible to get the raw data from an NSimageview in Swift?

I am using an imagewell to accept jpg images being pasted or dragged into my OSX app. The problme is that I am struggling to get the original jpg images as OSX seems to requires me to get the Tiff version of the NSImage if I want to uplod via Alamo Fire.
Does AlamoFireImage have a fancy way of getting the original url / original raw data without converting to Tiff first?
Actually, with an NSImageWell, you don't have much possibilities regarding the dropped image. It's a convenient class for showing dropped images but as soon as you need to do more, it's not up to the task.
I suggest you use an NSImageView instead, and add drag and drop capabilities to it like in my example here: https://stackoverflow.com/a/29233824/2227743
This way you can easily get the dropped image's URL (and filename), and the image data itself of course.