ImageMagick

Rails 4 Resizing and Cropping Images similar to Facebook

送分小仙女□ 提交于 2019-12-23 16:17:26
问题 I currently use yanex rich content api to get pages summaries in my rails 4 app. What is the best way to format the images similar to how Facebook does it? Facebook sometimes shows an image with the size of 377px by 177px which they crop and scale the original so it can maintain the aspect ratio. They also show images to fit a 90px by 90px div which just scale (no crop) the original image. you can see examples of the two different sizes here: https://www.facebook.com/pages/Coffee-News-Now

How to execute Imagemagick in PHP

自作多情 提交于 2019-12-23 15:53:40
问题 I found a very helpful post on here about cropping images in a circle. However, when I try to execute the imagemagick script using exec in PHP, I'm getting no results. I've checked to make sure the directories have the correct permissions and such. Is there a step I'm missing? Any insight would be much appreciated. Here's what my script looks like: $run = exec('convert -size 200x200 xc:none -fill daisy.jpg -draw "circle 100,100 100,1" uploads/new.png'); Edit: Imagemagick is installed. 回答1:

svg to png convertion with imagemagick in node.js

人盡茶涼 提交于 2019-12-23 15:44:57
问题 I am search a way in nodejs to convert an svg to png with the help of imagemagick https://github.com/rsms/node-imagemagick, without storing the resulting png in a temp file on the local filesystem. Unfortunately, I am unable to do this. And I didn't find example in the internet. Can someone give me an example? 回答1: var im = require('imagemagick'); var fs = require('fs'); im.convert(['foo.svg', 'png:-'], function(err, stdout){ if (err) throw err; //stdout is your image //just write it to file

Trying to run same command in command prompt not working

大兔子大兔子 提交于 2019-12-23 15:38:38
问题 I am making a program that seeks out secured PDFs in a folder and converting them to PNG files using ImageMagick. Below is my code. string WorkDir = @"C:\Users\rwong\Desktop\TestFiles"; Directory.SetCurrentDirectory(WorkDir); String[] SubWorkDir = Directory.GetDirectories(WorkDir); foreach (string subdir in SubWorkDir) { string[] filelist = Directory.GetFiles(subdir); for(int f = 0; f < filelist.Length; f++) { if (filelist[f].ToLower().EndsWith(".pdf") || filelist[f].EndsWith(".PDF")) {

cache resources exhausted Imagemagick

依然范特西╮ 提交于 2019-12-23 15:16:31
问题 I'm using Imagemagick on a rails app with Minimagick and i generate some pictogram with it. When i launch my process i have this error and i don"t find solution MiniMagick::Error (`convert -limit memory 2GiB -limit map 2GiB -limit disk 4GiB -background none -fill #000000 -font ttf/SELIS006N.ttf -pointsize 300 label: S public/pictogram_images/RECINTAN-EL-064-layer-1.png` failed with error: convert.im6: cache resources exhausted ` S' @ error/cache.c/OpenPixelCache/4078. convert.im6: no images

Writing animated gif using Wand and ImageMagick

送分小仙女□ 提交于 2019-12-23 14:38:51
问题 I'm having trouble figuring out how to write a basic sequence to an animated gif using Wand the ImageMagick binding. The basic convert ImageMagick commands I'm looking to reproduce in python: convert -delay 50 -size 500x500 xc:SkyBlue \ -page +5+10 /test/wizard.gif \ -page +62+50 test/wizard2.gif \ -loop 0 animation.gif 回答1: I was able to figure this out after all, by just passing the commands to terminal via os.system(): build = '''convert -delay 30 -size 500x500 \ -page +0+0 /Users/jkeilson

TCPDF - How do I extract pages form a PDF?

半世苍凉 提交于 2019-12-23 14:04:11
问题 I read somewhere that TCPDF was capable of splitting a PDF into individual pages or images. But there's no mention of this in the documentation or an example of how to do it. Can anyone shed some light on this and if it does't recommend a PHP based one I could use to achieve this. I'm trying to split a large PDF into high res images. 回答1: AFAIK this is not possible with pure TCPDF - you can combine it with fpdi (V 1.2.1 and up!) to achieve this. Other option to do what you want (with

Ruby increase file size on the fly for testing

我只是一个虾纸丫 提交于 2019-12-23 12:09:34
问题 This may sound weird, or why do you want to do that. I'm trying to write a cucumber feature to test uploading large image file (>16M) So, I don't want to store the large file on github or in my project. I'm using imagemagick to create an image but as far as I can do is just 1M. Can I increase the file size in ruby? I don't care about the content inside the file, just the file size. Thanks, is there anyway I could trick cucumber to believe me that I'm uploading a large file size? Thanks 回答1:

ImageMagick static compilation with another project gives linker errors

China☆狼群 提交于 2019-12-23 11:48:15
问题 I've downloaded the ImageMagick source, compiled the wizard to create a Visual Studio solution for static linkage, and included the static library Magick++ project in my sample project (code below). I've also added a dependency on that project and included the .lib file in the solution, nothing helps. #include <Magick++.h> int main() { Magick::Image image; bool test = image.isValid(); return 0; } This gives several linker errors, such as: unresolved external symbol "__declspec(dllimport)

how to convert 16-bit RGB Frame Buffer to a viewable format?

余生颓废 提交于 2019-12-23 10:58:13
问题 I'm working with someone else's code on a device which can put an image to /dev/fb/0 and show up on video out or send it over the network to a client application. I don't have access to the old source for the client app, but I know the following about the data: 720x480 16-bit RGB (I'm no sure if it's 5,5,5 or 5,6,5) RAW (no headers whatsoever) cat -able to /dev/fb/0 675kb How can I give this a header or convert it to JPEG, BMP, or a RAW type that I could then view in a desktop application?