jpeg

Create file from JFIF data

亡梦爱人 提交于 2020-01-04 14:11:52
问题 I have a dump of our LDAP database, and i'm attempting to extract all images from it using PHP. The images seem to be stored in JFIF format (at least, according to http://tools.ietf.org/html/rfc2798#page-5). However, i can't figure out how to create a JPEG file from this; I attempted file_put_contents to dump everything in name.jpeg, imagecreatefromstring 's output to imagejpeg and some variations on those. However, either I'm not using them correctly, or I'm just attempting this wrong

imagejpeg(); not generating image on host server , working fine on localhost

爱⌒轻易说出口 提交于 2020-01-04 11:43:08
问题 I have this code which is supposed to generate a captcha image of random number , it's working fine on localhost but not on my hosting, Can anyone help please? Can someone tell me where am i going wrong ? <?php session_start(); header('Content-type: image/jpeg'); $text= $_SESSION['secure']; $font_size =30; $image_width= 110; $image_height=40; $image=imagecreate($image_width,$image_height); imagecolorallocate($image, 255, 255, 255); $text_color = imagecolorallocate($image, 0, 0, 0); for($x=1;

imagejpeg(); not generating image on host server , working fine on localhost

那年仲夏 提交于 2020-01-04 11:38:46
问题 I have this code which is supposed to generate a captcha image of random number , it's working fine on localhost but not on my hosting, Can anyone help please? Can someone tell me where am i going wrong ? <?php session_start(); header('Content-type: image/jpeg'); $text= $_SESSION['secure']; $font_size =30; $image_width= 110; $image_height=40; $image=imagecreate($image_width,$image_height); imagecolorallocate($image, 255, 255, 255); $text_color = imagecolorallocate($image, 0, 0, 0); for($x=1;

JPEG in TIFF encoding

蹲街弑〆低调 提交于 2020-01-04 10:45:50
问题 I do this steps: TIFFEncodeParam tep = new TIFFEncodeParam(); tep.setCompression(TIFFEncodeParam.COMPRESSION_JPEG_TTN2); BufferedImage buff = new BufferedImage(newimage.getWidth(null), newimage.getHeight(null), BufferedImage.TYPE_BYTE_BINARY); //newimage is an awt image buff.createGraphics().drawImage(newimage, 0,0,null); ParameterBlock outPB = new ParameterBlock(); outPB.addSource(buff); outPB.add("myjpegfile.jpg"); outPB.add("tiff"); outPB.add(tep); PlanarImage outPI = JAI.create("filestore

JPEG in TIFF encoding

我只是一个虾纸丫 提交于 2020-01-04 10:43:12
问题 I do this steps: TIFFEncodeParam tep = new TIFFEncodeParam(); tep.setCompression(TIFFEncodeParam.COMPRESSION_JPEG_TTN2); BufferedImage buff = new BufferedImage(newimage.getWidth(null), newimage.getHeight(null), BufferedImage.TYPE_BYTE_BINARY); //newimage is an awt image buff.createGraphics().drawImage(newimage, 0,0,null); ParameterBlock outPB = new ParameterBlock(); outPB.addSource(buff); outPB.add("myjpegfile.jpg"); outPB.add("tiff"); outPB.add(tep); PlanarImage outPI = JAI.create("filestore

JPEG in TIFF encoding

大城市里の小女人 提交于 2020-01-04 10:43:10
问题 I do this steps: TIFFEncodeParam tep = new TIFFEncodeParam(); tep.setCompression(TIFFEncodeParam.COMPRESSION_JPEG_TTN2); BufferedImage buff = new BufferedImage(newimage.getWidth(null), newimage.getHeight(null), BufferedImage.TYPE_BYTE_BINARY); //newimage is an awt image buff.createGraphics().drawImage(newimage, 0,0,null); ParameterBlock outPB = new ParameterBlock(); outPB.addSource(buff); outPB.add("myjpegfile.jpg"); outPB.add("tiff"); outPB.add(tep); PlanarImage outPI = JAI.create("filestore

JPEG in TIFF encoding

馋奶兔 提交于 2020-01-04 10:42:54
问题 I do this steps: TIFFEncodeParam tep = new TIFFEncodeParam(); tep.setCompression(TIFFEncodeParam.COMPRESSION_JPEG_TTN2); BufferedImage buff = new BufferedImage(newimage.getWidth(null), newimage.getHeight(null), BufferedImage.TYPE_BYTE_BINARY); //newimage is an awt image buff.createGraphics().drawImage(newimage, 0,0,null); ParameterBlock outPB = new ParameterBlock(); outPB.addSource(buff); outPB.add("myjpegfile.jpg"); outPB.add("tiff"); outPB.add(tep); PlanarImage outPI = JAI.create("filestore

C#: Decoding JPEG images with 12-bit precision using Silverlight FJCore library?

泪湿孤枕 提交于 2020-01-04 06:15:45
问题 In my C# Silverlight application, I am trying to decode DICOM images in compressed JPEG transfer syntax, using the FJCore class library. The DICOM images are normally compressed with 12-bit precision. When trying to decode such an image using the original FJCore source code, I get an exception saying "Unsupported codec type", because in the original FJCore implementation only SOF0 (Baseline DCT) and SOF2 (Progressive DCT) Start-of-Frame markers are supported. If I change the implementation to

Converting to JPEG given image data and UTI

房东的猫 提交于 2020-01-04 05:47:10
问题 Given Data and its UTI, what's the proper way to convert it to JPEG? PHImageManager.default().requestImageData(for: asset, options: options, resultHandler: { (imageData: Data?, dataUTI: String?, _, _) in guard let imageData = imageData, let dataUTI = dataUTI else { return } if !UTTypeConformsTo(dataUTI as CFString, kUTTypeJPEG) { //TODO: Convert to JPEG } }) 回答1: Just had this issue with the PHImageManager returning the data as .heic instead .jpeg, this worked for me: PHImageManager.default()

Fast way to import and crop a jpeg in python lib

南笙酒味 提交于 2020-01-04 04:08:07
问题 I have a python app that imports 200k+ images, crops them, and presents the cropped image to pyzbar to interpret a barcode. Cropping helps because there are multiple barcodes on the image and, presumably pyzbar is a little faster when given smaller images. Currently I am using Pillow to import and crop the image. On the average importing and cropping an image takes 262 msecs and pyzbar take 8 msecs. A typical run is about 21 hours. I wonder if a library other than Pillow might offer