I just installed Gallery on my new Linux server and I too have the same Problem.
I am pasting the debug message below, if I Hand run the commmand too it does not succeed.
I built the NetPBM 10.8 for my Linux machine and I have all the binaries required.
The netpbm diagnostics also is happy.
----------------
Rotating photo.
(this may take a while)
Executing:
/usr/local/netpbm/bin/jpegtopnm /var/www/html/photoalbum/album10/ash_1.jpg | /usr/local/netpbm/bin/pnmflip -r270 | /usr/local/netpbm/bin/pnmtojpeg --quality=85 > /var/www/html/photoalbum/album10/ash_1.jpg.tmp
Results:
none
Error messages:
jpegtopnm: WRITING PPM FILE
jpegtopnm: Error writing single byte sample to file
pnmtojpeg: Error reading magic number from PBM file. Most often, this means your input file is empty.
Status: 1 (expected 0)
Executing:
/usr/local/jhead/jhead -te /var/www/html/photoalbum/album10/ash_1.jpg /var/www/html/photoalbum/album10/ash_1.jpg.tmp
Results:
Not JPEG: /var/www/html/photoalbum/album10/ash_1.jpg.tmp
Error messages:
Nonfatal Error : '/var/www/html/photoalbum/album10/ash_1.jpg.tmp' Invalid Exif start (1)
Status: 0 (expected 0)
Not closing this window because debug mode is on
--------
Thanks
Kdasu