how do get leptonica image library working on mac OS X - macos

Has anyone had any success with the leptonica image libary on mac os x?
I have installed using mac ports but I can't seem to get the libpng and other image libraries to work.
For example, I get the following kind of error, which I assume is linked to libpng
% ./lineremoval dave-orig.png
Error in pixReadStreamPng: function not present
Error in pixReadStream: png: no pix returned
Error in pixRead: pix not read
Error in lineremoval: pix not made
thanks!

i had the same issue. I solved it by rebuilding leptonica after putting this
#ifdef HAVE_LIBZ
#include "zlib.h"
#endif
in line 111 of pngio.c.
You can find the details and also a patch file here:
http://code.google.com/p/leptonica/issues/detail?id=56

Related

Getting error, ImageMagick/GraphicsMagick is not installed. windows

I am trying to use ImageMagick to manipulate photos in my rails app but when I upload the photo and post it I get this error,
"Picture Failed to manipulate with MiniMagick, maybe it is not an image? Original Error: ImageMagick/GraphicsMagick is not installed"
Also when I try do,
irb
require 'mini_magick'
filename = '/Users/me/tmp/testfile.jpg'
image = MiniMagick::Image.open(filename)
it gives error "gives error...MiniMagick::Invalid: ImageMagick/GraphicsMagick is not installed"
ImageMagick is added to the system path, and installed successfully, I can open imagemagick through the cmd line and bring up the interface, wondering if anyone can offer some help.
correct versions are installed of ImageMagick for my operating system.
Also vcomp120.dll is installed as well.
EDIT: This is just on the development sever, not, in production.
To answer, my own question, on the ImageMagick website binaries download section, windows x64 I used and there it has a list of three commands
magick logo: "logo.gif"
magick identify "logo.gif"
magick display "logo.gif"
I was getting error display: delegate library support not built-in '' (X11) # error/display.c/DisplayImageCommand/1888. with this. I then installed GraphicsMagick as per #Bonzo comment. Still had problems and read that alot of people were having trouble with converting images and installing the legacy utilities in the windows installer corrected this adding, convert.exe, mogrify, etc. I was then getting a error ...Wrong JPEG library version: library is 90, caller expects 62... I then searched and found that other peoples were having trouble with this error, and to remove the program that is having the conflicting "libjpeg" file, for me this was GraphicsMagic, I uninstalled and displaying images is fine now.
Also check your delegates configuration magick convert -list configure and make sure jpeg or whatever format is in there you are wanting to use.

SDL2 IMG_Load "unsupported image format" error message?

I'm trying to load a png image. libsdl2-dev and libsdl2-image-dev packages have been installed and I'm including SDL2/SDL_image.h. IMG_Init is working without error, but IMG_Load errors.
On my desktop PC (Ubuntu) it works (loads png into SDL_Surface), but it looks like my laptop (also Ubuntu) is not linking the required png library.
ldd (Desktop) libpng12.so.0 => /lib/x86_64-linux-gnu/libpng12.so.0 (0x00007ff58db3c000)
ldd (laptop) No libpng lib
Even though both these machines have this library in the same location.
How can I figure out why it is not getting linked?
Edit: IMAGE_Init(IMG_INIT_PNG) is causing error "PNG Images are not supported"
After removing libpng, libsdl2-dev, and libsdl2-image-dev I was able to re-install them and it works.

GLM errors " Parsing namespace 'glm' " (OSX 10.8)

I've been spending a couple of days trying to set up my project in Code::Blocks on a Macbook pro (2006) with OSX 10.8.1 (I got it for free!).
After installing Xcode, command line tools, and then restarting I got the basic gcc support (will uninstall Xcode and then just use cmd line tools when I get things working). Then I proceeded to cmake and make install GLEW, GLFW3 and GLM (GLM only needed make install). I then rebootet once more to get things mostly working, I'm down to four errors, and these come from the func_trigonometric.inl file that GLM uses. The build message is as follows:
/usr/local/includ... 165 current parser token 'if'
/usr/local/includ... 37 parsing namespace 'glm'
/usr/local/includ... 160 parsing function body 'tanh'
/usr/local/includ... 160 in compound statement ('{}')
note: diagnostic msg: Error generating preprocessed source(s).
I'm not sure where to go from here.
EDIT:
I tried to install GLM the normal way with just dragging the folder to the location it should be in (include), the error still persists, I really need help with getting rid of this error.
I found out what was causing the errors, the version of GLM I was using was too new for OSX 8.1.1
Changing out GLM from version 9.6 to version 9.4 fixed the errors.

what happened to SDL_mixer.h?

I am trying to get some open source C++ code to compile in xcode. It uses the SDL library. I downloaded SDL 2.0 for OS X and installed it and things are working -- but the download didn't seem to include the file SDL_mixer.h -- which is referenced in the code, as shown below.
#include <SDL/SDL_mixer.h>
What happened to this file? Did it get dropped from SDL? What do I do to work around the missing file to get the code working?
SDL Mixer has always been a separate library you have to install next to your SDL.
To fix your problem, download and install the library in such a way that SDL_mixer.h is located in an SDL/ folder of your include paths.
Install the SDL Mixer framework and add a reference to it in your project.
Include the SDL_Mixer.h header like so:
#include <SDL2_Mixer/SDL_Mixer.h>

issues with freeglut on mac os snow leopard (it builds fine via macports)

im on mac os snow leopard gcc 4.5.4 | gcc 4.2.1, trying to build the tutorials http://www.arcsynthesis.org/gltut/
one needs to build dir glsdk first. I install freeglut (prerequisite) via macports freeglut #2.8.0_1 (active) and manually copy and paste its lib and include folders in dir glsdk so that
ls ..../Tutorial_0_3_8/glsdk/freeglut -> include lib
(I couldn't build the freeglut provided that's why I replace it with the one from macports)
after fixing many errors (mostly due to legacy snippets included) I'm testing the build in Test dir and when I try to run the generated executable ./TestD, I get:
X Error of failed request: BadRequest (invalid request code or no such operation)
Major opcode of failed request: 34 (X_UngrabKey)
Serial number of failed request: 28
Current serial number in output stream: 28
what's this? a bit of search suggests this is a driver's problem(?)..
when I use glut with other gl code it runs just fine
my X11 is broken** and this seems to be the problem.
since it's tricky to build this set of tutorials, I repeat the steps I followed for anyone facing similar trouble
get the source https://bitbucket.org/alfonse/gltut/downloads, untar and fill in the gaps so that you have Tutorial_0_3_8 instead of Tutorial 0 3 8
in glsdk directory, comment out --"freeglut/freeglut.lua, in premake4.lua
in glsdk directory, ./premake gmake and then make config=release
in framework directory, framework.cpp, manually replace macros LOCAL_FILE_DIR & GLOBAL_FILE_DIR with "./data/" "./data/" & "../data/" respectively and comment out #include "directories.h"
build all the tutorials in a single step from root or those that you need, e.g. in Test directory put the right paths to include for freeglut headers and link with the:
in Test.make replace -I../glsdk/glutil/include and -L../glsdk/glutil/lib with paths from freeglut build via macports. Also in the same makefile link with -lglut instead of -lfreeglut
**dyld: Symbol not found: __cg_DGifGetLine
Referenced from: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO
Expected in: /opt/local/lib/libGIF.dylib
in /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO

Resources