png

Imagick: PNG support available in command line, but not available in PHP

。_饼干妹妹 提交于 2019-12-13 18:09:55
问题 I found that I did not have PNG support in my Imagick installation, so I installed libpng . Now I can see that PNG format is supported when I run a command convert -list format And conversion from PNG to JPG works fine from command line: convert a.png b.jpg But when I try to read a PNG file in PHP: $src = new \Imagick(); $src->readImageBlob( file_get_contents($file) ); // reading PNG format -it gives me Error 500 ("...no decode delegate for this image format") Also when I run phpinfo() - I

Display image in html which is returned as a MIME media type from an ajax call

别来无恙 提交于 2019-12-13 17:56:06
问题 I'm trying to display an image in PNG format (it is returned as a MIME media type image/png from the following code). Does it need to be saved somehow?: $.ajax({ type: "GET", url: url + "/api/image/", contentType: "image/png", async: false }) .done(function(msg) { // msg IS THE MIME MEDIA TYPE PNG IMAGE // HOW DO I DISPLAY THIS IMAGE INSIDE AN HTML PAGE? }) .fail(function(msg) { // failing is okay for image, just ignore it }); 回答1: Here's a solution using pure Javascript (fiddle): HTML <div

Why does png format get changed when on iPhone or iPad Device

你离开我真会死。 提交于 2019-12-13 17:38:59
问题 Interesting one this. I did do a bit Googling on the it but here we go. I have this png file. What I want to do is have it on my iPhone and send it to a server application on Windows. I use something like this: NSString *filePath = [[NSBundle mainBundle] pathForResource:IconFile ofType:@"png"]; NSData *icon = [[NSData alloc ] initWithContentsOfFile:filePath]; NSLog(@"File path is %@",filePath); NSLog(@" Bytes to send in Icon File %d",icon.length); Now this works just fine when I am on the

PNG image from imagelist

一曲冷凌霜 提交于 2019-12-13 16:42:25
问题 How do I take a picture from a TImageList and put it into a TImage (or return it as a TGraphic )? The important point is that a TImageList can contain 32-bpp alpha blended images. The goal is to get one of these alpha-blended images and place it in a TImage . This means at some point i would likely require a TGraphic . Although, strictly speaking, my question is about placing an image from an ImageList into an Image . If that can be accomplished without an intermedate TGraphic then that is

Compressing a PNG for use with CIFilter

和自甴很熟 提交于 2019-12-13 13:46:13
问题 I have an iPhone app that overlays an image over a view created by a XIB, using CIFilter CIHardLightBlendMode. The view is 1000x1000 pixels, and I want to maintain that size until the end. This makes the image files about 1 MB as a png, if there is any complexity. I've tried using JPGs, but it doesn't overlay the image onto the view on a device (it works on the simulator). I've tried compressing the PNGs, but they get garbled when they get overlaid over the view (they look identical to the

using ffmpeg to add overlay with opacity

别来无恙 提交于 2019-12-13 13:32:33
问题 I have a problem with ffmpeg,I try to add a png files over a video i found how to add just I want this png file have some opacity I tryed this line ffmpeg -n -i video.mp4 -i logo.png -filter_complex "setsar=sar=1;blend=all_mode='overlay':all_opacity=0.7" -movflags +faststart tmb/video.mp4 with this line ffmpeg return this error Cannot find a matching stream for unlabeled input pad 1 on filter Parsed_blend_1 and there the complet log ffmpeg version 2.7.5-0ubuntu0.15.10.1 Copyright (c) 2000

How do I get PNG image data as a decoded byte array using GWT?

匆匆过客 提交于 2019-12-13 12:45:26
问题 Using GWT I would like to read a PNG image and have the data accessible to me as a decoded byte array. On the client side I get the image using an ImageBundle, I then instantiate an Image and call setUrl. At this point, how do I get the image byte array from the image? 回答1: It's been a while since I did direct file i/o in Java, but here's something based off some of my old code: InputStream in = this.getClass().getResourceAsStream("/com/path/to/file.png"); ByteArrayOutputStream out = new

display two png images simultaneously using pylab

試著忘記壹切 提交于 2019-12-13 12:24:43
问题 I want to open two png image files and display them side by side for visual comparison. I have this code for opening one png file (which I got from unutbu on stackoverflow.com): import numpy as np import pylab import matplotlib.cm as cm import Image fname='file.png' image=Image.open(fname).convert("L") arr=np.asarray(image) pylab.imshow(arr,cmap=cm.Greys_r) pylab.title('title') pylab.show() Is there a way to modify this code to open and display 2 png files side by side with their own titles?

Is PNG decoding not thread safe under android?

久未见 提交于 2019-12-13 10:53:36
问题 Using Delphi 10.2.3: I am writing code that repeat-decodes the same set of PNG images in multiple threads over and over again. Once the thread is executed, it uses an FMX TBitmap component's "LoadFromStream" method to decode a PNG file loaded into a TMemoryStream (within the thread). Running under Windows, no issues. Running under Android I get multiple exceptions and it appears to trigger randomly on just some of the threads: 1. Exception "Can not activate current context" 2. EReadError

Wordpress: “Sorry, this file type is not permitted for security reasons” when trying to upload standard image files

我怕爱的太早我们不能终老 提交于 2019-12-13 10:19:14
问题 Does anyone know of any workaround for this? I'm trying to upload .jpg and .png files, both file types allowed in standard Wordpress settings, but I get the above error. The workarounds I've googled so far don't work as Wordpress no longer sees the files i'm uploading as images. These are the plugin: Disable Real Mime Check, and variations of code that allow unfiltered uploads in the functions.php file. I'm sometimes able to get my images uploaded but mostly not, and I can't see a pattern to