jpeg

Reading a progressively encoded 9000x9000 JPEG in Java takes 1 minute

戏子无情 提交于 2021-02-06 19:13:05
问题 When using javax.imageio.ImageIO to load a large-resolution (9000x9000) JPEG from disk, it takes more than 1 minute in my scala application. I tried creating a Java-only project, but it still takes too long - around 30 seconds. This is how I load the image: File file = new File("/Users/the21st/slow2.jpg"); BufferedImage image = ImageIO.read(file); Is there any way to improve performance on reading progressively encoded large-res JPEGs in Java? The image in question is this one (moderators,

Creating thumbnail images with C#

亡梦爱人 提交于 2021-02-06 09:24:31
问题 @functions{ public void GetThumbnailView(string originalImagePath, int height, int width) { //Consider Image is stored at path like "ProductImage\\Product1.jpg" //Now we have created one another folder ProductThumbnail to store thumbnail image of product. //So let name of image be same, just change the FolderName while storing image. string thumbnailImagePath = originalImagePath; originalImagePath = originalImagePath.Replace("thumb_", ""); //If thumbnail Image is not available, generate it.

Displaying an image created with imagecreatefromstring

跟風遠走 提交于 2021-02-04 15:00:54
问题 Let's say I have the code that looks something like: <?PHP // //... stuff here // $im = imagecreatefromstring( $imageData ); echo "<img src=" . /* what goes here? */ . "alt=\"the image\" />"; // // more stuff here // ?> What do I replace /* what goes here? */ with so my image data will display? Thank you. 回答1: What do I replace /* what goes here? */ with so my image data will display? The location you highlighted is the so called src attribute of the img HTML-tagDocs. The value is a so called

PHP/GD: How to handle jpg transparency?

点点圈 提交于 2021-01-29 07:16:25
问题 JPG doesn't support transparency. Yet you can export an image with transparent areas from for example GIMP. In that case the transparent areas will show either black or white in your browser, Windows explorer or other software. I regularly receive such files that I need to process and provide in several smaller formats. I do that with some PHP script using the GD library. The problem is that it is unpredictable whether those areas will turn out black or white in the processed versions. Even

What is the fastest way to convert JPEG byte data to raw greyscale byte information?

醉酒当歌 提交于 2021-01-28 09:22:09
问题 Since the Raw callback from takePhoto is not reliable I have to use the JPEG callback... What I'm basicly getting is a byte array which holds all the information in JPEG data-form. I now need to somehow get this to be only grayscale information with each pixel having a value of 0-255... At the moment I'm converting the jpeg data array to Bitmap using BitmapFactory.decodeByteArray and then converting the bitmap to grayscale by using getPixel(), which is pretty bad performance wise... Does

Converting a PDF to JPG with ImageMagick in PHP Gives Odd Letter Spacing

佐手、 提交于 2021-01-27 07:28:13
问题 I am trying to convert a PDF to a JPG with a PHP exec() call, which looks like this: convert page.pdf -resize 716x716 page.jpg For some reason, the JPG comes out with janky text, despite the PDF looking just fine in Acrobat and Mac Preview. Here is the original PDF: http://whit.info/dev/conversion/page.pdf and here is the janktastic output: http://whit.info/dev/conversion/page.jpg The server is a LAMP stack with PHP 5 and ImageMagick 6.2.8. Can you help this stumped Geek? Thanks in advance,

Converting a PDF to JPG with ImageMagick in PHP Gives Odd Letter Spacing

假如想象 提交于 2021-01-27 07:27:08
问题 I am trying to convert a PDF to a JPG with a PHP exec() call, which looks like this: convert page.pdf -resize 716x716 page.jpg For some reason, the JPG comes out with janky text, despite the PDF looking just fine in Acrobat and Mac Preview. Here is the original PDF: http://whit.info/dev/conversion/page.pdf and here is the janktastic output: http://whit.info/dev/conversion/page.jpg The server is a LAMP stack with PHP 5 and ImageMagick 6.2.8. Can you help this stumped Geek? Thanks in advance,

Converting a PDF to JPG with ImageMagick in PHP Gives Odd Letter Spacing

一曲冷凌霜 提交于 2021-01-27 07:27:03
问题 I am trying to convert a PDF to a JPG with a PHP exec() call, which looks like this: convert page.pdf -resize 716x716 page.jpg For some reason, the JPG comes out with janky text, despite the PDF looking just fine in Acrobat and Mac Preview. Here is the original PDF: http://whit.info/dev/conversion/page.pdf and here is the janktastic output: http://whit.info/dev/conversion/page.jpg The server is a LAMP stack with PHP 5 and ImageMagick 6.2.8. Can you help this stumped Geek? Thanks in advance,

Python Script to detect broken images

允我心安 提交于 2020-11-29 10:23:09
问题 I wrote a python script to detect broken images and count them, The problem in my script is it detects all the images and does not detect broken images. How to fix this. I refered : How to check if a file is a valid image file? for my code My code import os from os import listdir from PIL import Image count=0 for filename in os.listdir('/Users/ajinkyabobade/Desktop/2'): if filename.endswith('.JPG'): try: img=Image.open('/Users/ajinkyabobade/Desktop/2'+filename) img.verify() except(IOError