I'm trying to get django-wiki running.
It works well so far, except I can't display .jpeg images.
At first I had trouble when only importing jpeg files in the webapp.
I fixed this modifying setup.py of PIL's setup.py as follows:
JPEG_ROOT = libinclude("/usr/lib")
# Line 214
add_directory(library_dirs, "/usr/lib")
add_directory(library_dirs, "/usr/lib/x86_64-linux-gnu")
Jpeg libs I have currently installed:
libjpeg-progs
libjpeg62:amd64
libjpeg62-dev:amd64
libjpeg8:amd64
libopenjpeg2:amd64
After install PIL with pip install PIL, I get this output which doesn't look that bad, at least I thought so
*** TKINTER support not available
--- JPEG support available
--- ZLIB (PNG/ZIP) support available
*** FREETYPE2 support not available
*** LITTLECMS support not available
No error messages (and no "decoder ntót available") and I can view the images properly on my server, which means upload works great. But in the wiki only the file names are shown and when I click on them I get
"This image failed to load."
Could someone please help me? I can't find any error output (debug mode is activated).
Thanks in advance
You are compiling software! You need to install development libraries for these things to compile, e.g. apt-get install libjpeg-dev.
Also, install Pillow, it has less chances of failure to compile - pip install pillow.
Related
First of all, sorry for my english and sorry for taking your time, I'm pretty sure the answers are online but it seems like I can't find the right keywords for this issue.
The problem: Python2 is installed but still asked as a dependency for every python2 module I want to install with my package manager.
I built python2 from source on Archlinux in a proot environment
(because I use termux on a non rooted phone and it's probably why yay did not worked as expected to install python2) and I think I did it well because "python2" open the python command line and "python2 -V" return me "Python 2.7.18", i can execute python scripts with it, etc.
I built python by downloading and uncompressing python2 from python.org, then in the uncompressed file ./configure --enable-optimization , make -s and make install.
I'm a noob so i don't know but i probably just need a way to handle python2 with pacman or a way to tell pacman that python2 is indeed installed.
repo.
I know to handle manualy built pkgs with pacman, but not software built from source. So i'v found a PKGBUILD for python2 but (again, probably because of the proot) when i use makepkg here what's happen :
[...
...
...]
==> Extracting sources...
-> Extracting Python-2.7.18.tar.xz with bsdtar
==> Starting prepare()...
bsdtar: Removing leading '/' from member names
patching file Makefile.pre.in
patch: setting attribute security.selinux for security.selinux: Permission denied
==> ERROR: A failure occurred in prepare().
Aborting...
So if anyone know how could i make makepkg works as intended or how could i tell pacman that python2 is already installed, it would totaly make my day.
PS : I know python2 is deprecated and as it's not updated anymore the security is getting worse and worse, but it's not for my main setup so don't worry. I also think i could install modules manually but it is not something i wish to do since i'd like to install the all BlackArch repo.
I'm facing an strange problem with PIL. Whenever I am compiling the following code with python everything is ok:
from PIL import Image
file=Image.open("si.jpg")
file2=file.convert("L")
pix = file2.load()
print pix
colsize,rowsize=file2.size
for i in range(rowsize):
for j in range(colsize):
if pix[j,i]>250:
pix[j,i]=250
file2.save("ci2.pgm")
But when I compile the above code in SageMath Notebook, it gives an error “IOError: decoder jpeg not available”. Here is the scrrenshot :
I have found a similar problem here, but these solution does not work for me. My OS is Ubuntu 16.04 (32bit).
The image link :)
I want to get solution for SageMath. How do I solve this issue?
It seems your version of the Python package "Pillow"
(the Python Image Library) is missing the decoder for jpg.
To install it, quit Sage, and in a terminal, run the following:
$ sudo apt-get install libjpeg-dev
$ sage --pip install --no-cache-dir -I pillow
Then restart Sage and try running your code again.
I just install SimpleCV 1.3 on Windows 7. During the install I got a message: "this program could not have been correctly installed setuptools-0.6c11.win32-py2.7.exe". When I run the first example
>>> logo = Image("simplecv")
>>> logo.show()
I got an empty python window and I get a warning: "You need the python image library to save by filehandle"
Someone knows how to fix this?
thanks in advance
After the install error message, did you try reinstalling?
SimpleCV is supposed to include all the libraries it needs, so when installation failed it must have missed some libraries.
You could try installing the python image library (PIL) yourself.
I usually use this web site as a source of python libraries: http://www.lfd.uci.edu/~gohlke/pythonlibs/#pil (I think you should use Pillow-2.0.0.win32-py2.7.exe)
when I try to use a simple code
time_created = time.time()
tempPath = 'user_image/'+ str(request.user.id)+'/'+str(time_created)+'/'
print tempPath
path = default_storage.save(tempPath+'original.jpg', ContentFile(content_image.read()))
tmp_file = os.path.join(settings.MEDIA_ROOT, path) #this line gives error
image = open(tmp_file)
it gives me error : decoder jpeg not available
this is what I did to resolve it:
http://www.answermysearches.com/fixing-pil-ioerror-decoder-jpeg-not-available/320/
I am using python2.7
and Imaging-1.1.7
after following the above link, when i run python selftest.py on terminal, i get following output
python selftest.py
--------------------------------------------------------------------
PIL 1.1.7 TEST SUMMARY
--------------------------------------------------------------------
Python modules loaded from ./PIL
Binary modules loaded from ./PIL
--------------------------------------------------------------------
--- PIL CORE support ok
*** TKINTER support not installed
--- JPEG support ok
--- ZLIB (PNG/ZIP) support ok
--- FREETYPE2 support ok
*** LITTLECMS support not installed
--------------------------------------------------------------------
Running selftest:
--- 57 tests passed.
But when I access my application from browser, I still get decoder jpeg not available
Note: I restarted apache server (not sure if its required).
Do I need to do some config changes in Apache?
I searched on stackoverflow, and found similar questions, but none was dealing with apache.
I have had the same error. Reason was in other site run on server. It had old PIL in python path. So, cleaninig up python path or reinstallation of old PIL maybe can help you.
I am trying to re-compile sox source with mp3 support on CentOS 5. Note sox-12.18.1-1.el5_5.1 has been installed on my CentOS machine for a while.
Following http://techblog.netwater.com/?p=4, I installed the following packages using yum.
yum install gcc-c++ libmad libmad-devel libid3tag libid3tag-devel lame lame-devel flac-devel libvorbis-devel make
./configure shows the following.
BUILD OPTIONS
Debugging build............no
Distro name ...............not specified!
Dynamic loading support....no
Pkg-config location........$(libdir)/pkgconfig
Play and rec symlinks......yes
Symlinks enabled...........yes
OPTIONAL DEVICE DRIVERS
ao (Xiph)..................no
alsa (Linux)...............no
coreaudio (Mac OS X).......no
sndio (OpenBSD)............no
oss........................yes
pulseaudio.................no
sunaudio...................no
OPTIONAL FILE FORMATS
amrnb......................no
amrwb......................no
ffmpeg.....................no
flac.......................yes
gsm........................yes (in-tree)
lpc10......................yes (in-tree)
mp3........................yes
id3tag....................yes
lame......................yes
dlopen lame...............no
mad.......................yes
dlopen mad................no
oggvorbis..................yes
sndfile....................no
wavpack....................no
OTHER OPTIONS
ladspa effects.............no
magic support..............yes
png support................no
GOMP support...............yes
But after executing "make && make install", issuing
sox test.mp3 tmp1.mp3 reverse
returns
sox: Failed reading test.mp3: Do not understand format type: mp3
What am I missing here? Thanks.
I had the same issue.
Make sure that there is no other Sox installed on the server:
yum remove sox
Next:
make uninstall
make clean
./configure
make
make install