jpeg

Convert a jpg to a list of lists

删除回忆录丶 提交于 2019-12-25 00:37:57
问题 I'm trying to figure out how to convert a jpg into a list of lists (using python 3.2.3) such that: [ [red,blue,red,etc..], #line1 [blue,red,yellow, etc...], #line2 [orange,yellow,black,etc...], #Last Line ] Basically each list within the main list represents a horizontal line of colour values starting from the top of the image. I thought it was going to be easy, just write a little script to extract the data from the jpg file. Hah! After looking into that I realized that was going to be a lot

Image displayed upside down in mac preview, but displayed right side up in the browser

风格不统一 提交于 2019-12-25 00:18:58
问题 A jpg is rendered upside down on my mac but correctly in a safari browser on the same mac. What is the orientation data that is not correctly being read? Is it in the EXIF? 回答1: Here's how to display it with the correct orientation if (image.imageOrientation != UIImageOrientationUp) { image = [UIImage imageWithCGImage: image.CGImage scale: 1 orientation: UIImageOrientationUp]; } based on an answer by ravin Save UIImage, Load it in Wrong Orientation 来源: https://stackoverflow.com/questions

Passing an ActionScript JPG Byte Array to Javascript (and eventually to PHP)

最后都变了- 提交于 2019-12-24 19:33:44
问题 Our web application has a feature which uses Flash (AS3) to take photos using the user's web cam, then passes the resulting byte array to PHP where it is reconstructed and saved on the server. However, we need to be able to take this web application offline, and we have chosen Gears to do so. The user takes the app offline, performs his tasks, then when he's reconnected to the server, we "sync" the data back with our central database. We don't have PHP to interact with Flash anymore, but we

Saving an image (jpg) on a remote server without local hard disk

 ̄綄美尐妖づ 提交于 2019-12-24 15:13:55
问题 I have a linux app programmed in C which uses gdk for image stuff. The images are sent to a remote server through FTP (with libcurl). Currently I'm saving the images first to a local hard disk with gdk_pixbuf_save, but this seems kinda useless step. How difficult would it be to save the images directly on the remote server? I would also need to use the quality setting of jpg. 回答1: There is a gdk_pixbuf_save_to_buffer that can store data to a gchar buffer. I wasn't able to quickly find the

Base64 jpg to base64 Png in Ruby

与世无争的帅哥 提交于 2019-12-24 11:37:33
问题 I'm working with base64 files and i would like to convert a base64jpg image in a base64png image. Is there a way to do it? The reason is i'm using rsvg-convert to convert svg files into png files, but when i have a base64jpg in my svg, it's not working, But it works with base64 files. 回答1: In ImageMagick, this works for me. Create JPG base 64 file: convert rose: rose.jpg convert rose.jpg inline:rose_base64jpg The text file rose_base64jpg shows: data:image/jpeg;base64,/9j

Compressing an NSKeyedArchiver file that included UIImageView with loaded image

血红的双手。 提交于 2019-12-24 11:37:11
问题 I have a view with an UIImageView. It was loaded with either jpg or png image format. Says the jpg image version has a data size of 100k. I then used NSKeyedArchiver to save my view to a file. The size of the file is getting about 3MB. If I used the png version of the image, the archived file is still around 3MB. I then used zlib to compress the archived file. But it does not seem to have much effect. Anything I can do to get it back to close as much as possible the 100k area? BTW: If I used

Codeigniter failed to open stream permission when upload images

陌路散爱 提交于 2019-12-24 11:14:47
问题 Code: $filename = '12345.jpeg'; $source = imagecreatefromstring($imageData); $imageSave = imagejpeg($source,$filename,100); imagedestroy($source); $this->ftp->connect(); $this->ftp->upload($imageSave,'/public_ftp/incoming/'.$filename,'ascii', 0775); $this->ftp->close(); Error: Codeigniter failed to open stream permission when upload images. 回答1: Probably it is a permissions issue. Try this: sudo chmod -R 777 path/to/public_ftp/incoming/ However, this will give permission to everyone. For

c# how to write a jpg image from request.binaryread

泄露秘密 提交于 2019-12-24 10:55:35
问题 I have a flash app which sends raw data for a jpg image to a particular url Send.aspx . In Send.aspx I am using request.binaryread() to get the total request length and then read in the data to a byte array. Then I am writing the data as jpg file to the server. The code is given below: FileStream f = File.Create(Server.MapPath("~") + "/plugins/handwrite/uploads/" + filename); byte[] data = Request.BinaryRead(Request.TotalBytes); f.Write(data, 0, data.Length); f.Close(); The file is getting

Compressing LMDB files

会有一股神秘感。 提交于 2019-12-24 08:43:33
问题 I am wondering if anyone has tried using compression techniques for their LMDB files? Typically, lmdb files typically do not use any compression. I am wondering if anyone has successfully stored data in an lmdb using jpeg compression on lmdb and then used it for caffe. I need this because I am working on a developer board with very limited storage space. If so, can you please provide steps/code to do this? thanks 回答1: Caffe also supports HDF5 which supports compression. If your dataset is

file_get_contents jpg corrupt download

心已入冬 提交于 2019-12-24 07:31:06
问题 I am downloading this photo using function: file_get_contents(), and it seems to be corrupted. But original photo looks fine. Original photo: original photo Downloaded photo: Download photo Code: $current = file_get_contents($image); $name = '/tmp/img/' . uniqid().".jpg"; file_put_contents($name, $current); $tmpImages[] = $name; 回答1: Try this. function savephoto($urlpath,$savepath) { //Download images from url $in = fopen($urlpath, "rb"); $out = fopen($savepath, "wb"); while ($chunk = fread(