Mathematica not exporting gifs properly - wolfram-mathematica

I'm trying to export an image to a .gif file in Mathematica (version 7). Let's take a basic example:
Export["pic.gif",Graphics[{Circle[]}]]
There are no error messages, and a pic.gif file is in fact created, but the file's totally blank; 4 KB size, 0x0 dimensions, if I open the file no window appears.
I've tried messing with the format, such as
Export["pic.gif",Graphics[{Circle[]}],"GIF"]
and
Export["pic.gif",Graphics[{Circle[]}],"Image"]
but to no avail. Export works with other file-types (tried it with .jpg and .png with no trouble), so I'm not sure what the problem is.

Version 7 is several years old
on version 9.01 (the newest) with MAC OS X this works just fine
yehuda

Related

NSIS MUI_WELCOMEFINISHPAGE_BITMAP not shown on Windows 10

I use NSIS to create a Windows installer for one of my projects. The script can be viewed on GitLab.
I just noticed that the MUI_WELCOMEFINISHPAGE_BITMAP image is shown as expected on Windows 7, but not on Windows 10, using the latest version NSIS 3.06.1.
Here's the installer started on Windows 7:
and the very same installer started on Windows 10:
I create the image from an SVG file in the following way:
inkscape --export-filename=image.png image.svg
convert image.png BMP2:image.bmp
Is this a bug? Or what do I have to change to make the image also appear on Windows 10?
Okay, after some further investigation, I can answer the question myself.
The problem is apparently the convert step. It messes up the image dimensions. Actually, the image has to be (and is) 164 x 314 px. The convert output seems to report a size of 20578468 x 1572865 px.
Seems like Windows 7 doesn't care, but Windows 10 does.
Saving the image using the GIMP made it work, using the correct settings: Either an indexed image, with or without RLE encoding or an 8-bit-RGB one. In each case, one has to check "Compatibility Options" → "Do not write color space information".
That's it ;-)

Copy Pillow image to GIMP through X11 clipboard

I'm using Xubuntu 14.04 (an X11/Linux distribution). I've written a Python program using the Pillow (Python Imaging Library) and Tkinter libraries to render user-entered text into an image using a custom bitmap font. I want to quickly bring this image into the running GIMP process as a new layer. Currently it operates by saving the image to a PNG file and then requiring the user to go dig for the PNG file using GIMP's file picker. I thought it would be more convenient if I could save the image to the X11 clipboard so that I could paste it into GIMP.
But all the examples for interacting with the clipboard in Tkinter that I could find through Google are for text, not images. I found how to copy an image in Windows (1, 2): save a BMP file to a BytesIO, chop off the first 14 bytes, and send the rest to the Windows clipboard as a CF_DIB. But I don't want to require Wine. There also exists an answer about how to do it in GTK+; is it worth porting the application from Tkinter to PyGTK (for GTK+ 2) or PyGObject (for GTK+ 3), despite the installation headache that it may cause for Windows users? Or is there an easier way than the X11 clipboard to get a PIL.Image.Image instance into GIMP?
You can send an image to an open GIMP process by using its "remote" feature. If GIMP is already running, the command gimp path/to/file.png finds GIMP's window and drops the image into the running process. This means you can create a folder with tempfile.TemporaryDirectory, save the image into this folder, and open it in GIMP.
tempfile.TemporaryDirectory is new in Python 3.2 and not available in Python 2. tempfile.NamedTemporaryFile is available in older versions of Python, but the tempfile module docs state that on UNIX, the filename can be passed to another program, but on Windows, the temporary file cannot be opened by other programs while it is open in the program that created it, and once the program that created it closes it, it will already have been deleted. Windows users with both Python 2 and Python 3 installed will need to use Python 3.3 or later in order to let the shebang line processor (PEP 397) select the appropriate version of Python.
Or if you don't want to depend on Python 3.3 or later, you could have your program detect whether it's running on Windows or POSIX and then make the appropriate action available. Under Windows, it would copy the image to the clipboard, and under POSIX, it would write the image to a tempfile.NamedTemporaryFile, pass the filename to gimp or whatever other program the user specifies to receive it, and then destroy the temporary file once a new one is created or the application closes.

NSCocoaErrorDomain error 516 caused by bringing PNG into Xcode

I am trying to import PNG images into Xcode (version 4.6.2) on my Mac. These images were created on a Windows 7 machines, and stored on a NAS box.
In finder, when I drag the images from my NAS box into Xcode I get the following error:
The operation couldn't be completed. (NSCocoaErrorDomain error 516).
Using Get Info on that file, Sharing & Permissions only states that You have custom access.
Ive managed to copy these images onto a folder on my Mac's desktop. Using Get Info on these local images, Sharing & Permissions that My User, Staff and Everybody all have Read & Write permissions. I can make copies of these images on my Mac and I can edit these images on my Mac.
When I try and drag these local images into Xcode, I still get the same NSCocoaErrorDomain 516.
EDIT:
Because I read somewhere that the extended attributes could be causing this error, I have just used a Terminal Window to copy the files using this command:
cp -X button.png button2.png
But again, this gives me the same NSCocoaErrorDomain 516.
EDIT 2:
This is getting really infuriating now. If I rename the files, the Xcode accepts the files with no problem. If I rename the file back to what it was, Xcode kicks out the NSCocoaErrorDomain 516 error again. I could go and rename the hundreds of images and change the references to them in my code, but I would really rather find out the cause of this problem.
Ive been making the images on a Windows machine and importing them into Xcode fine for the last two weeks without problem. Today I do the same thing and suddenly this problem occurs. Nothing has changed to the Windows machine or the NAS box. My Mac has not been updated, nor am I aware of any changes to my Mac.
What am I doing wrong? How can I get these images into Xcode?
From Foundation Constants Reference
NSFileWriteFileExistsError = 516
I think You have folder/file named button.png

how to check windows icon file for image quality

I have recently used an icon file received from our marketing team. The icon file when opened in resource editor (Visual Studio 2008) looks like this.
The same file when opened-and-saved in IcoFX appears correctly in resource editor.
My marketing team uses some tools (Picture2Icon ) in Mac and produces the icon file which appears to be corrupt or not fully correct. The same file saved by IcoFx seems to be correct. What is causing the ICOFX out to be correct?
The result is the exe shows bad icons. The exact case where the image is bad is not clear- It is reported in case where color quality is set to be 'medium' (windows XP). It is worse when executable is "selected" in windows explorer.
Here is one icon that shows problem: https://github.com/jayanmn/icontest/blob/master/icontest.ico
Full sample code to create exe is at https://github.com/jayanmn/icontest/
So question is given an ico file, how can I ensure that it works fine on WindowsXP, Windows Vista and Windows7?
I took a good look at your icontest.ico file provided from the GitHub website and discovered that the solution is an easy fix.
First, let me illustrate the problem as I see it on a Windows XP 32bit System using the freeware IrfanView software which is an excellent image viewer for this task.
Here is a composite shot I made illustrating the error for 5 of 6 layers as seen using IrfanView:
To fix the above icontest.ico file, one would think frames 1,2,3,4 and 6 are bad. But the opposite is true! It turns out that frame 5 is the culprit!.
Specifically, frame 5 has compression set on this frame which is causing the issue.
The actual fix that's required is to merely re-save the icontest.ico file without compressing that layer. For this task, the freeware GIMP application which is an excellent image editor is perfect for this task.
Just re-save the icon file with GIMP but remove the compression for the 5th layer as shown below:
The final result is a properly rendered icontestResaved.ico as seen in IrfanView (Tip: To view frames of an icon file in IrfanView, use the Red Arrows that's next to the frame number, i.e. 1/6):
The best way to ensure that the file works in different Windows Operating System's is to actually have a machine available, as the rendering engine is unique and emulators might not work as intended.
For the curious: Setting all layers to be compressed in GIMP resulted in a icon that was not viewable in Windows Explorer.
Tip: To view the reference images above at original size, right mouse-click and choose View Image.
Status Update: Consider installing Axialis IconWorkshop™ Lite Version 6.3.1.1 to handle all your icon development workflow needs. It's a free Visual Studio 2008 Plugin provided by Axialis themselves!

Emacs: Is it possible to browse images in a directory? On Windows?

I read about auto-image-file-mode , which I think displays image files as images within emacs. I'd like to use it. This doc says it has been replaced by image-mode.
I can't get either to work.
Any help?
I got it to work, by downloading the packages for PNG and JPG from GnuWin32, and putting the required DLLs into the \emacs\bin directory:
From LibPng:
libpng-config
libpng12-config
libpng12.dll
libpng3.dll
zlib1.dll
From jpeg:
jpeg62.dll
Now it works. Here's a screen-shot of editing a SO question, being displayed in emacs.
You could also drop those DLLs on the OS's PATH, before running runemacs.exe. That works, too.
It can depend on what version and where you got your windows emacs binary. If you have the windows emacs23 binary from the gnu ftp site then I don't think it is compiled with image support (at least this was the case several months ago). I use the patched windows emacs23 binary from EmacsW32 which does have image support. I also have (auto-image-file-mode) in my .emacs file.
Using Emacs 23.1 (on Fedora 12) when I visit a *.png file, it shows up as an image in the Emacs buffer. Similarly for *.gif and *.pdf files. The mode was advertised as Image[png], fwiw.
Once you've gotten Emacs to show images, you can also see thumbnail images in these contexts, in addition to Dired (using image-dired):
In buffer *Completions* during file-name completion or completion of (file) bookmarks. You need Icicles for this. Showing the thumbnails is optional -- you can toggle it from the minibuffer using C-x t (cycles among: showing only images, images + file names, and only file names).
In buffer *Bookmark List* (from C-x r l), when you hit C-h RET to see info about the current line's bookmark. You need Bookmark+ for this.
bookmarksbookmark

Resources