LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   How to add jpeg support to imlib2 at build time (https://www.linuxquestions.org/questions/slackware-14/how-to-add-jpeg-support-to-imlib2-at-build-time-837313/)

x111 10-10-2010 11:38 PM

How to add jpeg support to imlib2 at build time
 
I'm building my slackware system from a minimal set of packages. I've got X and fluxbox up and running, and I'm trying to "slack-build" feh which depends on imlib2 to set background wallpapers.

The problem is trying to "feh" any image gives the error message:
Code:

feh WARNING: wall2.jpg - No Imlib2 loader for that file format
feh - No loadable images specified.

I think I've come close to a solution at this page which suggests add "JPG" support to imlib2 at build time. But this's for use with "emerge" of Gentoo.

Is there any method to add a parameter when building imlib2 for it to support JPG, PNG etc...? I've had libjpeg, libpng installed in my computer before building imlib2 but the same problem still persists.

Thanks for all your help.

Squall90 10-11-2010 12:42 AM

Quote:

NOTE: feh requires giblib and imlib2, both available on SlackBuilds.org.
When compiling, the order must be imlib2, then giblib, then feh.
Source: http://slackbuilds.org/repository/13.1/graphics/feh/

You should probably install giblib and imlib2 first and then feh.

bogzab 10-11-2010 01:21 AM

Recently did exactly as suggested above and
Quote:

feh mypic.jpg
works fine for me. admitedly mine was not a minimalist installation but I needed both imlib2 and giblib from slackbuilds.

x111 10-11-2010 01:32 AM

Oh thank you Squall90, bogzab. The point is I've built all those 3 packages from slackbuilds and still cannot set the background with feh.

Squall90 10-11-2010 03:06 AM

I looked at the code of the feh.SlackBuild and I couldn't found anything about imlib2. Then I downloaded the feh source and I found an interesting parameter for the configure file:
Quote:

--with-imlib2=DIR
You could try to compile feh with this option. But I can't tell you the DIR.. (I'm at work and I can't test Linux things here ^^)

x111 10-11-2010 04:47 AM

Oh my bad, let me clarify a little: When I first tried to open an PNG image with feh and the command failed, I assumed that feh wouldn't work with JPEG too, hence the thread name and the example. I've try opening an JPEG and it works perfectly. Just a couple of minutes ago I've browsed through /usr/lib/imlib2/loader/ and I saw that there was a loader for JPEG and some other formats. But there is no loader for PNG, despite the fact that, as I mentioned before, I'd had libpng (1.4.2) built and installed before I built imlib2.
Wondering why imlib2 failed to "include" it in the build.

I think you've given a good direction, Squall90. I'm going to customize the build script for feh (passing specific imlib2 location to "configure") and see if it brings any good result. I'll post the result here to keep you informed. Thank you for the support.

Squall90 10-11-2010 09:33 AM

Quote:

Originally Posted by x111 (Post 4123697)
Just a couple of minutes ago I've browsed through /usr/lib/imlib2/loader/ and I saw that there was a loader for JPEG and some other formats. But there is no loader for PNG, […]

Hmm.. This is weird. I just downloaded the source package (but not the SlackBuild, I don't think it is required since I originally only wanted to check out what options are available for it's configure script.
I have built the package only with i686 CFLAGS. Bizarrely, I have png.(la|so|a) files in /usr/local/lib/imlib2/loaders (I didn't configured a prefix.)
What if you compile it from source -- without the SlackBuild? (Before running "make install" please create a directory where the program should be installed to, for example /home/x111/imlib2-bin and then run make install this way:
$ DESTDIR="/home/x111/imlib2-bin" make install
Then it will be installed to /home/x111/imlib2-bin and not in the root tree -- just for testing. If you already knew this, sorry, I only want to make sure you don't overwrite or erase other programs and files.)

x111 10-11-2010 10:47 AM

Ah yes! I've compiled imlib2 from source manually, and the png loaders showed up in /usr/local/lib (not in /usr/lib/). Now feh can work with png format too. So good. It seems that some things need to be fixed in the build script. But I think I'll stop investigating into this imlib2 stuff here and move on to compiling other packages. The next one will be a window manager named i3.

Thank you again Squall90.


All times are GMT -5. The time now is 12:51 AM.