GraphicsMagick new a image on the fly - graphicsmagick

I am using the GraphicsMagick Wand to process images. I don't know how to new a image on the fly. I don't how to do it. There isn't any demo on the Doc
Now, I just load a 1px png image to temporarily solve it. I don't want load a image each time. It seems not the best solution.
Please help.

I found the solution. I think it will help others. So I answer my question.
First, You need use MagickReadImage method to read a string XC:
MagickReadImage(intern->magick_wand, "XC:")
Then, set image size by using MagickScaleImage method:
MagickScaleImage(intern->magick_wand, columns, rows)
At last, set the format:
MagickSetImageFormat(intern->magick_wand, format)

Related

AR.JS custom marker generator returns .patt file with all 0s

I'm trying to create an A-Frame/AR.js project that uses custom markers, it works well with marker presets but every time I upload a custom .patt file nothing shows up in front of the camera.
I'm using this custom marker generator. At first I thought maybe the issue is with the images I'm uploading but then I realized that no matter the image everytime I click 'Download marker' .patt file comes back with all 0s. So my assumption is that something is wrong with the generator itself when (not) picking up uploaded images?
I was wondering if anyone else ran into the same issue / realization and found a way around it.
Thank you!
Solved! It only works with .jpg images - .patt file comes back with all 0s when .png images are being uploaded. I hope other folks will find it helpful, too.

How do I extract a .jpg or .png from a website using a zoom window

I'm trying to download an image from this website:
http://digitalcollections.tcd.ie/home/index.php?DRIS_ID=MS58_003v
from their digitization of the Book of Kells. They obviously want to share the images with the world. My problem is that when I right-click to save image, all I get is a portion of the image about 750 by 950 pixels. If I wanted to, I could screen shot it, segment by segment and then assemble it all in MSPaint, but that is tedious and I might not get the re-allignments right. So, my question is, "How do I get a nice, complete .png image from that website, even though they are using a zoom window?"
Any help would be very appreciated.
The most detailed images have the URL like this:
http://digitalcollections.tcd.ie/content/14/pages/MS58_001r/image_files/12/0_0.jpg
which goes up to 9_12.
The MS58_001r is MS58_00 followed by the page's "name" which you can extract using:
$(".toc_page_number").each(function (index, element) {
console.log(element.textContent.split(" ")[1]);
});
You can easily create a script in python which generates all the links and downloads them, and using PIL you can stitch them together.

Why my image source is not working for my current local machine but it's working for the web sources?

I have a div and I want to show images as innerhtml using the back end C# code. So that I can generate them as I want them to. In here for innerhtml everything is running fine but the images. While I am giving it a path from my current localhost the images are not showing but while I am putting an web url its working why?
Even if I tested taking the suggestion from the visualstudio like I put a static image in front end and took its path but its still not working. I user the server.mappath(test) this function too.
test = "App_Data/images/37id4.jpg";
divfifth.InnerHtml ="<img src='"+test+"' />";
This says the path is not found here is my code given.
if anyone can suggest me to generate these in better way please suggest.
Hello #Borshon Aeolus Saydur , Its a nice question. Try to give add path like "~/images/.." format. instead of "Images/..".
i have solved it by moving my image folder one layer up.although i dont know what was the wrong in previous layer.but its now working after moving it to its upper layer..

How to return the generated image by phpThumb and not the original one with code appended?

I'm generating images through phpThumb on my Wordpress based website using Magic Fields 2 but I'm having problems posting those images to We Heart It and other websites since they don't recognize it as an image due to all the code appended.
Therefore I was wondering if there's a way to make phpThumb return the actual generated image thumbnail link instead of the original link with all the code appended like:
http://www.mywebsite.com/wp-content/themes/basetheme/phpThumb/phpThumb.php?src=http://www.mywebsite.com/wp-content/files_mf/1331856830IMG_0286.jpg&w=364&h=200&zc=1&q=95
Is there any way to achieve this?
http://ailoo.net/2008/07/wordpress-plugin-autothumb-phpthumb/ <-- I'm using this plugin for the same! :)

How to display a QImage in QWebKit?

Is there any way to display a QImage (in memory, not on filesystem) in a QWebFrame without writing the image out to a temporary file?
One option might be using the data URI scheme. You basically base64 encode your picture and write the complete data into the URL.
For example:
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAD///+l2Z/dAAAAM0lEQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8yw83NDDeNGe4Ug9C9zwz3gVLMDA/A6P9/AFGGFyjOXZtQAAAAAElFTkSuQmCC
WebKit should support these URIs either directly, or as part of a HTML source code, like
<img src="data:image/png;base64,blaBLABLA" />
Be aware: if your image is big, you might be running into some constraints. Usually this used more for small stuff like icons.
Damn. Steffen beat me to it! :)
To add, you could convert to base 64 by saving the image to a QBuffer(&byteArray) and then saying byteArray.toBase64()

Resources