Copy GIF data from clipboard with WinJS - clipboard

I'm writing a WinJS app and it would be a nice feature to handle animated GIFs. After some research, if would seem that in order to do that, that the data is copied to the clipboard using the little know CF_GIF clipboard format
how to get animated gif image from browser clipboard api?
but looking over the WinJS documentation for clipboard formats
http://msdn.microsoft.com/en-US/library/windows/apps/windows.applicationmodel.datatransfer.standarddataformats
it doesn't seem like CF_GIF is available, and when I copy a GIF to the clipboard and look at dataPackageView with the command
var dataPackageView = Windows.ApplicationModel.DataTransfer.Clipboard.getContent();
it just shows up as a bitmap. Can anyone tell me if it is indeed possible to get an animated GIF from the clipboard or some kind of work around?

CF_Bitmap is the way to go here.
You COULD make a private data format, and put the entire GIF on there. And you could paste it into other instances of your app. But it wouldn't work with anything else, unless you also provided it as CF_Bitmap.
OK, there's another way. You could dump to a .gif file, then place the CF_HDROP (file pointer) onto the clipboard. Then when you paste, it's like pasting a file from windows explorer. That may work for some apps.
Yeah, like I said, use CF_Bitmap.

Related

How do I flatten/compress a pdf which is generated with prawn?

I am using prawn to generate pdf files which have lots of images so they come out quite large. I can open the file in Adobe Acrobat and then save it using the "reduce file size" option, and a 164MB file shrunk to 7MB and retained all of the image quality. I would like to replicate this compression in Ruby. I have tried using the compression settings which prawn offers and they have not had any effect on the file size. I suspect there must be a way to do it with RMagick, but I haven't figured it out yet.
I apologize for not including any code samples showing what I have tried, but I removed the prawn compression settings when they didn't have any effect, so I don't have anything to show.
Have you tried simply making a copy of the PDF with RMagick? That is, read in the PDF and write it back out again.
Also, check with the ImageMagick folks at https://www.imagemagick.org/discourse-server/. Any advice they offer you can be implemented via RMagick.

Extract images from .swf viewer?

I'm wondering how it possible to extract images from .swf viewer?
Note that .swf file have not images itself.
For example I'm trying extract images from AVON catalogue from this link - http://avon.com.ua/PRSuite/eBrochure.page?index=1&cmpgnYrNr=201404&pageNo=0
Any ideas?
Best way is to put the .swf file in a decompiler for image extraction. Decompilers are smart enough to extract images for you and arrange them.
JPEXS Free Flash Decompiler is a more popular one
http://www.free-decompiler.com/flash/
You can extract other useful content from it as well.
Just download the .swf file from the website
A while back (like around 1999) I wrote a set of tools for Flash animations.
One of the tools is swf_dump which can be used to extract objects (i.e. write the objects in a form of script that sswf can nearly recompile...)
The tool also allows for extracting images that are inline (not downloaded dynamically by the flash animation, if so, anyway, you could as well download those images manually, you'd need the URL, though.)
The command line you can use is:
swf_dump -d my-animation.swf
Then your current folder will be littered with all the images that were found in the flash file. It extracts JPEGs and PNGs. The source can be compressed (SWF or CWF are supported.)
Now, you're on your own to compile that thing... The project is here and is in great need of updating (but Flash is kind of going out too...)
https://sourceforge.net/projects/sswf/

Previews of matlab figures in Windows explorer (utility to set an image as the thumbnail for another file)

Has anyone come up with a way to make thumbnail type previews for matlab figures in windows?
I'm getting tired of saving a .png along with the .fig file just so I know what was in it.
A useful helper for this would be a command line utility for windows that can be provided with an image file and told to use that as the basis for the preview for a given file.
I could write a helper function in matlab that saved the .fig, made a temporary image file, then pushed that into the thumbnail using the command line utility.
You can write a function in C++ that tells Windows how to generate thumbnails from your file.
This link explains about it. Check out the section about Thumbnail Image handler. This is the function that you will need to implement.
From what I managed to understand, the procedure is this:
Write a in-process COM server (DLL) that implements IThumbnailProvider interface
Put the DLL file somewhere on your computer.
Write an entry to the registry, by using the procedure described in this page.
That still leaves you with the problem of thumbnail extraction from .fig file. As far as I know, fig files are nothing but mat files. I am fairly sure that it is possible.
You will need a custom save function for all figures. It will print a thumbnail of the image (by using the print command), and save it inside the figure.
I know that it isn't much information, but it can help you to get started. You might as well ask someone who is highly proficient in COM technology for more help. Thus, I recommend adding a COM tag to the question.
Edit(1) - I've found a good tutorial on the subject:

Apple's PDFKit (or anything else), extract positions of images

I need to extract the positions of all images from a pdf-file on the Mac. For now I am considering PDFKit, but that if there is a better way of doing that, i'm open to suggestions.
So the question is, how can i parse a PDF file on the Mac, receiving (images, not necessarily), their positions within a page and page numbers using PDFKit or, probably, another library or even a program (I don't have to build it into my program, i just need it done).
UPD Seems like it is possible to do that using Adobe's Acrobat SDK.
Thanks in advance,
Timofey.

Wordpress Theme (JVPress) Header Graphic Won't Display in Internet Explorer 8

I have a Wordpress site (www.nurseresumetips.com) and I'm using a theme named JVPress.
This theme lets you to upload a custom header graphic. If you open the page in Firefox the header graphic displays, however when I open it in Internet Explorer 8 the image is not found.
The link that Wordpress is generating is: http://www.nurseresumetips.com/wp-content/uploads/20110419033853_nrt.jpg
This link works in Firefox but not in Internet Explorer.
I just want to know if anyone could point me in the right direction.
Thanks
Having looked around, I think you may be tripping over a problem like this, where your JPEG is encoded in a slightly odd format. Looks like CMYK is accepted as a format by some browsers, but not others.
Depending on your software, you might be able to find a way of saving in a more usual colour encoding -- in Photoshop, for example, try the specific "save for web" option.
Given the content of your image, I'd actually suggest saving the file as a PNG, anyway. JPEG is best for photographic images; for textual images like this one, PNG will probably (a) be more efficient, (b) look better -- no encoding artefacts around the nice solid lines you have, and (c) not have this odd problem you're facing.

Resources