[SOLVED] Problem cropping thumbnails

Lapinoo
Lapinoo's picture

Joined: 2004-05-08
Posts: 378
Posted: Thu, 2005-03-17 17:05

I encounter a problem when cropping thumbnails.

I imported my G1 gallery and the 2 cropped thumbnails did not appear correctly (a gallery broken image is displayed).
I tried to regenerate those thumbnails with the cropping function ; although it says that the cropping was succesful, the thumbnail is a broken image each time I select anything smaller than the whole image.

I tried to modify the order of the toolkits, but it does not change anything.

FYI, importing cropped thumbnails used to word at least two months ago. I don't know if the problem is related to more recent versions of G2 or to a newer FC2 package.

Any idea ?

----

Gallery URL (optional):
Gallery version: latest CVS
Webserver (with version): Apache 2.x
Datatabase (with version): MySQL
PHP version (eg 4.2.1):
phpinfo URL (optional):
Graphics Toolkit(s): all
Operating system: Fedora FC2 (all updates applied)
Web browser/version: Firefox
G1 version (for migration bugs):

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Fri, 2005-03-18 08:07

Can you verify that this is this bug ?

 
frederik.kunz
frederik.kunz's picture

Joined: 2005-03-21
Posts: 37
Posted: Mon, 2005-03-21 00:49

I have exactly the same problem, and this is not related to ImageMagick - it also happens with the PNM toolkit.

Gallery version: latest CVS (03/20/2005)
Webserver (with version): Apache 2.0.52
Datatabase (with version): MySQL 4.0.24
PHP version (eg 4.2.1): 4.3.10
phpinfo URL (optional): http://fmail.ods.org/phpinfo.php
Graphics Toolkit(s): all
Operating system: Gentoo (most recent on x86 platform)
Web browser/version: Firefox 1.0.1 / IE 6.0

 
Lapinoo
Lapinoo's picture

Joined: 2004-05-08
Posts: 378
Posted: Mon, 2005-03-21 22:21

bharat,

I removed my G2 files and database, synced my CVS installation, activated just the following modules : core (obviously), IM, image frame, comments, exif parser and migration...
...Cropped thumbs are once again broken.

I don't think this is related to the problem you refer to.

By the way, another unrelated problem : with this CVS image, I could not activate all modules during the installation : they were listed as activated but did not appear as. I tried to uninstall some of them and then reinstall one of them... I was greeted with a DB error !

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Tue, 2005-03-22 10:28

Ok, this sounds like a different issue with cropped thumbnails. Would you please file it as a bug so that we can address it?

Regarding your activation issue, the only time I've ever seen that happen is in the case where you didn't completely empty out your g2data directory. Are you sure that you deleted it completely before your reinstall?

 
frederik.kunz
frederik.kunz's picture

Joined: 2005-03-21
Posts: 37
Posted: Tue, 2005-04-12 21:12

I opened a bug report here:

http://sourceforge.net/tracker/index.php?func=detail&aid=1180151&group_id=7130&atid=107130

The cause of the problem seems to be the translation. If the language is set to english it works, if it is set to German, Dutch, Italian, French, ... it does not work.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Wed, 2005-04-13 21:50

frederik.kunz, please PM me the url and a login to your G2 so I can try this out on your setup.. I can't reproduce the problem.

 
Lapinoo
Lapinoo's picture

Joined: 2004-05-08
Posts: 378
Posted: Thu, 2005-04-21 17:06

mindless,

I just tried to change the default language from French to English US but it does not solve the situation.

Here are some URLs from pictures whose thumbnail is incorrect :
http://www.starway.org/g2/main.php?g2_view=core:ShowItem&g2_itemId=6596
http://www.starway.org/g2/main.php?g2_view=core:ShowItem&g2_itemId=7205

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2005-04-21 18:35

the issue frederik.kunz reported is fixed in current cvs/nightly snapshot.
Lapinoo, you can PM me a login to your G2 and put your G2 in buffered debug mode if you'd like me to take a look.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Fri, 2005-04-22 00:09

Lapinoo, here's the debug output from a crop attempt on your system:

Quote:
copy(/path/to/g2data/albums/name1/name2/aai.jpg,
/path/to/g2data/cache/derivative/6/5/6546.dat)
file_exists(/path/to/g2data/cache/module/imagemagick/0/0/0.inc)
fopen(/path/to/g2data/cache/module/imagemagick/0/0/0.inc, rb, 0)
fread(Resource id #130, 4096)
fclose(Resource id #130)
tempnam(/path/to/g2data/tmp/, imgk_)
getcwd()
chdir(/path/to/g2data/tmp/)
Executing: ( "/usr/bin/convert" "-quality" "75" "-crop"
"787x563+337+274" "-geometry" "200x200" "+profile" "*"
"/path/to/g2data/cache/derivative/6/5/6546.dat"
"/path/to/g2data/tmp/imgk_dkRpEo" ) 2>/path/to/g2data/tmp/g2dbgSah37t
file_exists(/path/to/g2data/tmp/g2dbgSah37t)
filesize(/path/to/g2data/tmp/g2dbgSah37t)
fopen(/path/to/g2data/tmp/g2dbgSah37t, r, 0)
feof(Resource id #132)
fgets(Resource id #132, 4096)
feof(Resource id #132)
fgets(Resource id #132, 4096)
feof(Resource id #132)
fclose(Resource id #132)
unlink(/path/to/g2data/tmp/g2dbgSah37t)
Regular Output:
Error Output:
convert: geometry does not contain image
`/path/to/g2data/cache/derivative/6/5/6546.dat'.

Status: 0 (expected 0)

I have no idea what this means. Maybe try netpbm or a different version of imagemagick.

 
Lapinoo
Lapinoo's picture

Joined: 2004-05-08
Posts: 378
Posted: Fri, 2005-04-22 07:40

I tried NetPBM some time ago and it didn't work either. This time, it worked :

file_exists(/data/g2_data/cache/module/netpbm/0/0/0.inc)
fopen(/data/g2_data/cache/module/netpbm/0/0/0.inc, rb, 0)
fread(Resource id #130, 4096)
fclose(Resource id #130)
copy(/data/g2_data/albums/Events/Maru100/aai.jpg,
/data/g2_data/cache/derivative/6/5/6546.dat)
tempnam(/data/g2_data/tmp/, npbm_)
Executing: ( "/usr/bin/jpegtopnm"  "--quiet" 
"/data/g2_data/cache/derivative/6/5/6546.dat"  |  "/usr/bin/pnmcut"  "335"
 "272"  "787"  "563"  |  "/usr/bin/pnmscale"  "--quiet"  "-xysize"  "200" 
"200"  |  "/usr/bin/ppmtojpeg"  "--quality=85" >
"/data/g2_data/tmp/npbm_IQ7cUD" ) 2>/data/g2_data/tmp/g2dbgQvKotR
file_exists(/data/g2_data/tmp/g2dbgQvKotR)
filesize(/data/g2_data/tmp/g2dbgQvKotR)
unlink(/data/g2_data/tmp/g2dbgQvKotR)
Regular Output:
Error Output:
Status: 0 (expected 0)
rename(/data/g2_data/tmp/npbm_IQ7cUD,
/data/g2_data/cache/derivative/6/5/6546.dat)
file_exists(/data/g2_data/cache/derivative/6/5/6546.dat)
filesize(/data/g2_data/cache/derivative/6/5/6546.dat)
file_exists(/data/g2_data/cache/derivative/6/5)
rename(/data/g2_data/cache/derivative/6/5/6546-meta.inccs7cGS,
/data/g2_data/cache/derivative/6/5/6546-meta.inc)
file_exists(/data/g2_data/cache/derivative/6/5/6546-fast.inc)
 
Lapinoo
Lapinoo's picture

Joined: 2004-05-08
Posts: 378
Posted: Fri, 2005-04-22 07:44

ImageMagick is the default Fedora Package :

olympic ~ $ which convert                                                   [3]
/usr/bin/convert
olympic ~ $ rpm -qif /usr/bin/convert                                       [4]
Name        : ImageMagick                  Relocations: (not relocatable)
Version     : 6.2.0.7                           Vendor: Red Hat, Inc.
Release     : 2.fc2                         Build Date: Thu 17 Mar 2005 04:11:12 PM CET
Install Date: Thu 31 Mar 2005 05:52:12 AM CEST      Build Host: tweety.build.redhat.com
Group       : Applications/Multimedia       Source RPM: ImageMagick-6.2.0.7-2.fc2.src.rpm
Size        : 8120390                          License: freeware
Signature   : DSA/SHA1, Wed 30 Mar 2005 06:31:32 PM CEST, Key ID b44269d04f2a6fd2
Packager    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
URL         : http://www.imagemagick.org/
Summary     : An X application for displaying and manipulating images.
Description :
ImageMagick(TM) is an image display and manipulation tool for the X
Window System. ImageMagick can read and write JPEG, TIFF, PNM, GIF,
and Photo CD image formats. It can resize, rotate, sharpen, color
reduce, or add special effects to an image, and when finished you can
either save the completed work in the original format or a different
one. ImageMagick also includes command line programs for creating
animated or transparent .gifs, creating composite images, creating
thumbnail images, and more.

ImageMagick is one of your choices if you need a program to manipulate
and display images. If you want to develop your own applications
which use ImageMagick code or APIs, you need to install
ImageMagick-devel as well.

I don't know how many of us use Fedora, but it is likely going to be a recurrent problem.

 
Lapinoo
Lapinoo's picture

Joined: 2004-05-08
Posts: 378
Posted: Fri, 2005-04-22 08:02

I did a few more research : it seams that ImageMagick 6.2.0.7 is the latest official release for FC2, FC3 and FC4.

Many Fedora users are going to run into it ! :(

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Fri, 2005-04-22 08:06

Lapinoo, your last netpbm dump had no error message, everything was alright.
and what should we do with the imagemagick information? yes, you have a convert and obviously it's version 6.2.0.7....great.

 
Lapinoo
Lapinoo's picture

Joined: 2004-05-08
Posts: 378
Posted: Fri, 2005-04-22 16:30

valiant,

I just wanted to say that every vanilla Fedora (FC2, FC3 and FC4) system won't be able to crop thumbnails with their default ImageMagick package.

Since Fedora is probably one of the most common Linux distribution used to run G2, many users are going to run into this problem when they switch to G2.

So, either ImageMagick 6.2.0.7 is buggy and should be fixed if we notify IM developpers and/or Fedora mainainers, either G2 doesn't use "convert" as it should be.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Sun, 2005-04-24 08:59

I've made a fix for this. Basically, I prevented imagemagick from pipelining -crop and -geometry in the same convert call. It's out to mindless for review right now...

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sun, 2005-04-24 15:19

maybe someday someone who understands imagemagick's command line parameters will help us with our module.. i have no clue how these mysterious combinations of params do weird things.

 
Lapinoo
Lapinoo's picture

Joined: 2004-05-08
Posts: 378
Posted: Tue, 2005-04-26 17:42

bharat, mindless,

Thanks a lot !

I'll wait a few days for my CVS copy of G2 to receive this patch and I'll let you know if the problem is still there ! :wink:

 
Lapinoo
Lapinoo's picture

Joined: 2004-05-08
Posts: 378
Posted: Tue, 2005-04-26 21:27

It now works OK!

tempnam(/data/g2_data/tmp/, imgk_)
file_exists(/data/g2_data/cache/module/imagemagick/0/0/0.inc)
fopen(/data/g2_data/cache/module/imagemagick/0/0/0.inc, rb, 0)
fread(Resource id #129, 4096)
fclose(Resource id #129)
getcwd()
chdir(/data/g2_data/tmp/)
Executing: ( "/usr/bin/convert"  "-quality"  "75"  "-crop" 
"710x531+367+350"  "/data/g2_data/albums/Events/Maru100/aai.jpg" 
"/data/g2_data/tmp/imgk_Qt02AU" ) 2>/data/g2_data/tmp/g2dbgsCeORs
file_exists(/data/g2_data/tmp/g2dbgsCeORs)
filesize(/data/g2_data/tmp/g2dbgsCeORs)
unlink(/data/g2_data/tmp/g2dbgsCeORs)
Regular Output:
Error Output:
Status: 0 (expected 0)
chdir(/opt/gallery)
rename(/data/g2_data/tmp/imgk_Qt02AU,
/data/g2_data/cache/derivative/6/5/6546.dat)
tempnam(/data/g2_data/tmp/, imgk_)
getcwd()
chdir(/data/g2_data/tmp/)
Executing: ( "/usr/bin/convert"  "-quality"  "75"  "-size"  "200x200" 
"-geometry"  "200x200"  "+profile"  "*" 
"/data/g2_data/cache/derivative/6/5/6546.dat" 
"/data/g2_data/tmp/imgk_uoVzim" ) 2>/data/g2_data/tmp/g2dbggKSyRf
file_exists(/data/g2_data/tmp/g2dbggKSyRf)
filesize(/data/g2_data/tmp/g2dbggKSyRf)
unlink(/data/g2_data/tmp/g2dbggKSyRf)
Regular Output:
Error Output:
Status: 0 (expected 0)
chdir(/opt/gallery)
rename(/data/g2_data/tmp/imgk_uoVzim,
/data/g2_data/cache/derivative/6/5/6546.dat)
file_exists(/data/g2_data/cache/derivative/6/5/6546.dat)
filesize(/data/g2_data/cache/derivative/6/5/6546.dat)
file_exists(/data/g2_data/cache/derivative/6/5)
rename(/data/g2_data/cache/derivative/6/5/6546-meta.incFDPXtX,
/data/g2_data/cache/derivative/6/5/6546-meta.inc)
file_exists(/data/g2_data/cache/derivative/6/5/6546-fast.inc)
 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Wed, 2005-04-27 19:16

Hooray! Sadly it's now two calls to convert, so it's slower. But slow is faster than broken :-)