image-manipulation

iPhone JPG image has non-standard magic bytes ff d8 ff e1?

安稳与你 提交于 2020-01-02 07:07:50
问题 My web app checks the first four bytes against the file extension before accepting uploaded images. A coworker showed me images from his iPhone which are being rejected. These have a different fourth byte (e1 = 225 instead of the expected e0 = 224). Is this usual for iPhones? Are there other possible magic byte strings used in JPG files? Edit: found this useful list: http://www.garykessler.net/library/file_sigs.html 回答1: They seem to indicate a sub category of JPEG in some way. What I have

iPhone JPG image has non-standard magic bytes ff d8 ff e1?

≯℡__Kan透↙ 提交于 2020-01-02 07:07:01
问题 My web app checks the first four bytes against the file extension before accepting uploaded images. A coworker showed me images from his iPhone which are being rejected. These have a different fourth byte (e1 = 225 instead of the expected e0 = 224). Is this usual for iPhones? Are there other possible magic byte strings used in JPG files? Edit: found this useful list: http://www.garykessler.net/library/file_sigs.html 回答1: They seem to indicate a sub category of JPEG in some way. What I have

Algorithm design: Image quantization for most prominent colors

ε祈祈猫儿з 提交于 2020-01-01 15:03:31
问题 So I'm working on a way to extract dominant colors as perceived by humans from an image. As an example, here's a photo: https://500px.com/photo/63897015/looking-out-for-her-kittens-by-daniel-paulsson Most humans would think the 'dominant' color is that piercing azure of the eyes. Using standard quantization, however, that blue disappears completely when you drop below 16 colors or so. The eyes only take up 0.2% of the canvas, so going for the average doesn't work at all. Project Details : I'm

Smart way of resizing images in PHP [closed]

百般思念 提交于 2019-12-31 03:05:16
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . I was wondering if someone can help me with an image resize function written in PHP but one wich has to resize an image, but in a

C#/WPF image transformation over a trapezoid

一世执手 提交于 2019-12-29 08:37:13
问题 I have an image which I want to scale/stretch it over a trapezoid in WPF. Is there an easy way of doing it? I want to achieve 3D effect / perspective / bending. Basically taking a 2D image and bending it in 3D space. This is what I want to accomplish: original: new: * * * * * * * * Another note, I need this to happen very fast. I tried using this code, and the performance is unusable: http://www.vcskicks.com/image-distortion.php Any help would be greatly appreciated. Thanks a lot in advance!

Cropping with drawImage not working in Safari

两盒软妹~` 提交于 2019-12-29 07:34:08
问题 I'm working on some simple image manipulation functions with canvas. The user uploads an image, is able to rotate and crop it and then clicks ok. The image is then split in half with each half drawn mirrored to two canvas elements, like this: Original Mirrored It all works great in Chrome, Firefox, IE and Android devices. Safari won't play nice though. All the image manipulation works fine except the split function. It does draw to one of the canvas elements, but the other is just black. I've

java image crop

守給你的承諾、 提交于 2019-12-29 07:07:09
问题 I am aware of BufferedImage.getSubimage However, it cant deal with cropping images that are smaller than the cropping size throwing the exception: java.awt.image.RasterFormatException: (y + height) is outside raster I want to be able to crop either a PNG/JPG/GIF to a certain size however if the image is smaller than the cropping area centre itself on a white background. Is there a call to do this? Or do I need to create an image manually to centre the image on if so, how would I go about this

How to add extra meta data to PNG?

拈花ヽ惹草 提交于 2019-12-29 07:04:08
问题 is there a way to add some extra metadata to a PNG file and then retrieve it with PHP ? like Comment field. 回答1: If you have ImageMagick installed, it comes with two utilities: mogrify and identify. To add comments: $ mogrify.exe -comment "My test comment" plogo.png To retrieve comments: $ identify.exe -verbose plogo.png | grep -i "comment:" comment: My test comment I don't know if mogrify/identify functions are available as PHP libraries, but you can always use the php system command. 来源:

GD! Converting a png image to jpeg and making the alpha by default white and not black

≡放荡痞女 提交于 2019-12-28 10:45:13
问题 I tried something like this but it just makes the background of the image white, not necessarily the alpha of the image. I wanted to just upload everything as jpg's so if i could somehow "flatten" a png image with some transparently to default it to just be white so i can use it as a jpg instead. Appreciate any help. Thanks. $old = imagecreatefrompng($upload); $background = imagecolorallocate($old,255,255,255); imagefill($old, 0, 0, $background); imagealphablending($old, false);

GD! Converting a png image to jpeg and making the alpha by default white and not black

岁酱吖の 提交于 2019-12-28 10:45:12
问题 I tried something like this but it just makes the background of the image white, not necessarily the alpha of the image. I wanted to just upload everything as jpg's so if i could somehow "flatten" a png image with some transparently to default it to just be white so i can use it as a jpg instead. Appreciate any help. Thanks. $old = imagecreatefrompng($upload); $background = imagecolorallocate($old,255,255,255); imagefill($old, 0, 0, $background); imagealphablending($old, false);