I am working on an image encryption project, so I first converts color image to gray and do the rest, after encryption I can see the image only using
imshow(grayImg,[])
Not by
imshow(grayImg)
but if I store the image with
imwrite(grayImg,outputFileName);
Then it isn't saving as expected or not as I saw when using imshow(grayImg,[])
Does anyone know what kind of error am I making?
Related
I want to make changes to the incomingAvatarView while using the MessageKit library.
This change will not change in previously uploaded avatarView images. Incoming avatar will change according to the answer given.
If I had to explain it with pictures, I can say it this way.
enter image description here
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.
My code is just this:
<img src="uploads/619671548171334115-961656431.jpg" alt="a">
You can see this here yourself:
https://moviesre.com/ogb/addtestimonial/testtt.php
This is the image: https://moviesre.com/ogb/addtestimonial/uploads/619671548171334115-961656431.jpg
See it is not flipped, but in the web page it is displaying flipped. What's up?
Edit: Not all images are getting roated on this server. Some images with smaller file size (in pixel not memory) are displaying normal
Maybe your uploaded image is rotated, but is being corrected because it contains rotation data in its EXIF ('Exchangeable Image File Format' is all the information that is automatically embedded into an image file when a photo is taken using a modern digital camera) section.
You can see EXIF data of your local file from exifdata.com and also you can see EXIF data of your uploaded file (that server is providing to the browser) by using php function exif_read_data()
You can get full explanation this answer of #matt-gibson
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.
For example, I can convert the second image into NSData and then place it inside metadata inside the first image and then when I open the first image and read the metadata I can get the NSData and turn it into an UIImage.
How would I go about doing this? All the metadata tags I see are not large enough to support another picture. I know picture in picture is quite common on desktop apps so I'm interested in getting it to work on the iPhone.
Is metadata the correct way to do this or is there another way?