jpeg

Java library for reading and writing IPTC metadata to JPEG and TIFF

余生颓废 提交于 2020-02-11 05:51:07
问题 Does anyone know some opensource Java library for reading and writing IPTC metadata to JPEG and TIFF? Now I'm using Apache Sanselan. Unfortunately, it can only read IPTC, not write (http://commons.apache.org/sanselan/formatsupport.html). Will be very grateful for your assistance. Denis. 回答1: Take a look at IIM4J. Use IIMWriter to write IPTC IIM tags into (jpeg) images. 回答2: The Apache Commons Imaging (formerly sanselan) has added support for writing IPTC metadata in the svn repo code for

Chrome toDataUrl quality param is not effect when export jpeg

妖精的绣舞 提交于 2020-02-06 05:29:14
问题 Use canvas.toDataURL('image/jpeg', 1) in Chrome, the image is lose a little seriously, but in Firefox, It's ok, almost lossless, even use default quality value 0.92. It seems does not working by setting the quality in Chrome. 回答1: It's a known issue and it's due to how chroma subsampling is handled. Chrome do this differently than Firefox and Safari. The latter ones uses 4:4:4 at 1.0 setting while current Chrome doesn't. However, it seem as the latest Canary (version 33) do the same as the

Chrome toDataUrl quality param is not effect when export jpeg

非 Y 不嫁゛ 提交于 2020-02-06 05:28:29
问题 Use canvas.toDataURL('image/jpeg', 1) in Chrome, the image is lose a little seriously, but in Firefox, It's ok, almost lossless, even use default quality value 0.92. It seems does not working by setting the quality in Chrome. 回答1: It's a known issue and it's due to how chroma subsampling is handled. Chrome do this differently than Firefox and Safari. The latter ones uses 4:4:4 at 1.0 setting while current Chrome doesn't. However, it seem as the latest Canary (version 33) do the same as the

Adding custom metadata to jpeg files

家住魔仙堡 提交于 2020-02-03 05:29:16
问题 I'm working on an Image processing project(C++) and I need to write custom metadata to jpeg file after the processing is complete. How can I accomplish this? Is there any library available to do it ? 回答1: If you're talking about EXIF Metadata you may want to look at exiv2 which is a C++ library for processing EXIF metadata. There is a second lib which is called libexif and is written in C. Exiv2 has a view examples on their website and a the API is well documented. UPDATE: If you want to add

The image saved as JPEG with Pillow is different from the original image.

寵の児 提交于 2020-01-30 08:52:10
问题 I have a 3-d numpy array and save it using Pillow as JPEG image. When I reloaded the image using Pillow, the resulting numpy array is different. I write a demo code for this: from PIL import Image import numpy as np file_extension = 'jpeg' # generate a sample image image = range(1, 2*2*3+1) image = np.uint8(np.array(image).reshape(2,2,3)) print 'image', image img = Image.fromarray(image, "RGB") img.save('test.'+file_extension) # load image loaded_image = Image.open('test.'+file_extension)

VBA: Copy cells, paste as a picture, then save as a picture?

旧城冷巷雨未停 提交于 2020-01-29 19:10:27
问题 I have the following code: Range("A1:M28").CopyPicture Appearance:=xlScreen, Format:=xlPicture Sheets.Add.Name = "Without Formatting" Worksheets("Without Formatting").Paste _ Destination:=Worksheets("Without Formatting").Range("A1:M28") That copies some cells then pastes them as a picture in another worksheet, is there a way of saving the picture (preferably as a jpeg) into a specific location so that I can then use the picture in an email? 回答1: I have used the following in the past. It

Android Create Custom Exif attributes for an image file

≡放荡痞女 提交于 2020-01-28 01:54:07
问题 currently i am trying to add custom exif tag/data to an image file that is in photo album. I am able to modify the existing tags defined in ExifInterface class However, i want to store custom data, such as user id of my app user, but it seems there is no way i can create a custom exif attribute the closest solution I found is here, but does not work, 回答1: Try saving the Exif data with the tag: "UserComment" Code: String mString = "Your message here"; ExifInterface exif = new ExifInterface

shifting a negative signed value is undefined

杀马特。学长 韩版系。学妹 提交于 2020-01-25 21:55:47
问题 I am starring at the original JPEG standard (ITU 81), in particular the figure Figure F.12: extending the sign bit of a decoded value in V : For reference the SLL terms means: shift left logical operation (see page 15 of the PDF) Now the famous libjpeg implementation decided to implement it this way (quite direct transcription): /* * Figure F.12: extend sign bit. * On some machines, a shift and add will be faster than a table lookup. */ #ifdef AVOID_TABLES #define HUFF_EXTEND(x,s) ((x) < (1<<

Image not displaying in IE only

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-24 20:47:27
问题 I have an image tag <img src="https://biossantibodies.com/image-raw/4449.jpeg"> Where it displays properly in Chrome/Firefox/Safari, but not IE. Result Fiddle link: https://jsfiddle.net/bheng/6z3u7dxm/ Chrome IE Console Error Network Tab Result How can I debug this? 回答1: set up the IE debugger to record console messages for blocked and insecure content... Tools>Internet Options>Advanced tab, check "Always record developer console messages". Save changes... now when you open the dev tool it

python file I/O with binary data

你。 提交于 2020-01-23 19:44:44
问题 I'm extracting jpeg type bits from mp3 data actually it will be album arts. I thought about using library called mutagen, but I'd like to try with bits for some practice purpose. import os import sys import re f = open(sys.argv[1], "rb") #sys.argv[1] gets mp3 file name ex) test1.mp3 saver = "" for value in f: for i in value: hexval = hex(ord(i))[2:] if (ord(i) == 0): saver += "00" #to match with hex form else: saver += hexval header = "ffd8" tail = "ffd9" this part of code is to get mp3 as