My Linux gcc program is generating an image as a two dimensional array of pixel data, that I want to print out through CUPS.
The available CUPS_FORMAT_??? is very dicouraging. Tried CUPS_FORMAT_AUTO and send the image as TIFF, it failed. The TIFF data is verified by making perfectly viewable .TIF of it. Making JPEG is far too complicated, but can CUPS_FORMAT_RAW be used? I fails to find a spec of what to feed the cupsWriteRequestData() with using this format. All searches ends up with priner side stuff, nothing about client API. Any help, please?
Related
I'm trying to print using NodeJS some PDF file to an IP printer through IPP.
However, my print only supports these document format:
application/octet-stream
image/urf
image/pwg-raster
There're plenty of methods of converting the PDF to an image, but I'm not sure how can I convert that image (png/jpg) to image/urf - image/pwg-raster codification to be able to print it.
Any tips?
While making a printing app, i found myself needing to do exactly that.
And like you, found mostly nothing.
So i made my own, available as standalone utilities here: https://github.com/attah/ppm2pwg/
pdf2printable from there can do pdf to pwg or urf raster directly (they are pretty much the same format).
Also; application/octet-stream just means auto-detect. And apart from the odd broken implementation listing only that, and Postscript printer with bonus PDF support, that is only between the other formats listed.
I'm building a project where people can upload files, I would like to then display those files in a browser where people can interact with them (vote, comment etc)
However, this means I need to programatically build the html depending on the format of the video or image. Is there a way to feed a file (or filename) into a library, and determine whether I need to display it in a video element or an image element? Even a list of video formats vs image formats would help but I haven't seen anything in regards to that.
No module can reliably determine the file type. The user could either change the extension or even the magic number of the file to obfuscate it. The only reliable way it to try to pass file to some image / video transcoder to let it decide or error out if the format is invalid. This way you know you are working with known formats since all files are transcoded to your specific extensions. That could be mp4 or png. I recommend using handbrake for videos and sharp for images. Leaving the NPM links down below:
https://www.npmjs.com/package/handbrake-js
https://www.npmjs.com/package/sharp
The image is given as Base64 encoded string, I had decode and pass to BitmapFactory class, then I got a log saying skia returned false. I did the fix by using FilterInputStream still its failing. So to identify the issue with image decoding part, I did the hexdump and compare with iOS one, it was identical. So now I'm sure that issue with BitmapFactory class. One thing I noticed that, when I put the binary output to a file and copy to Mac, clicking on the file I could see the image. So I was trying to figure out, what is the different between the Image Decoder in Android and iOS.
I have a nodejs server that receives images encoded in base64 through a websocket. I would like to do some image manipulation on those images and send them back. I searched a little bit on the net to find some library to help me doing this, but all I could find were libraries that take images stored somewhere in the server side, do the manipulation and save back the image. Apparently all of them take as input a string containing the filename of the image, so I guess under the hood they are fetching the image manually through a file stream.
My question is, is there a library that may help me working directly on base64 data (that is, passing the data as input to the functions) or should I save every time the image on the server, modify it and send it back? I would rather not go with the latter because I'm working on some high-performance application, and all this saving/loading looks a waste of cycles. Otherwise, do you see some other way I could achieve this (that is, getting the image file without saving and loading it back, for example)?
Thanks.
Work with Buffers.
var img = new Buffer(img_string, 'base64');
// Work with your images like other tutorials do.
This one can work with "readable streams": https://github.com/aheckmann/gm
See the second set of examples in the readme.
I wish to digitally sign my image collection which consists of JPG , TIFF , BMP , SWf , Fla files.
My question is how to digitally sign these images? If I sign JPG or Tiff , whether signature will get attached to these files (as it happens in document files like PDF or MS word etc)? If so where it get store in file metadata fields , or remain outside? Can i extract signature data?
Please note I wish to sign these images Individually and do not want to get converted into any other format like PDF. Also I donot wish to sign it using email client.
In general those formats were not designed with signing in mind, so your best option is to create a detached signature and keep it near the file. An alternative is to use wrapping signature but then other software won't be able to display the image until you remove the wrapper.
Storing the signature in metadata can be possible for some formats but what applications would be able to handle this?
I know it has been a long time, but you might want to look into steganography. Metadata can be extracted and removed from files. Steganography will allow you to embed digital signatures(encrypted phrases) in a way that is almost only detectable using statistical analysis.
You can also create a mime container which will contain the original image and a detached signature.
Attached signatures are only useful for specific apps, as they are not standard.
Try answering the posters question folks, and not giving another unneeded and unwanted opinion, it's way to common these days in my humble opinion.
Obviously what the poster asked for is to use a signature to copyright his works, so you need to sign the image, period, And a method to do so.
So let's see... grab Gimp or Photoshop. Get your image and create a new layer with transparent background. write in a signature with your mouse or digital pen in an area near the bottom right edge. Choose merge layers and flatten image. Seems like that would do it.