[SOLVED] Horrible quality on thumbnails and resized images

apeacock

Joined: 2005-03-08
Posts: 14
Posted: Tue, 2005-03-08 17:02

I'm using Gallery2 CVS and images resized with imagemagick have a horrible quality (I also had this problem with beta1, but I'm not sure if I was using netpbm or imagemagick). It looks like all my images have a quality of 0. I put galery into debugmode, and I think I found the offending command:Executing: ( "convert" "-quality" "" "-size" "150x150" "-geometry"
"150x150" "/home/apeacock/g2data/albums/36.jpg"
"/home/apeacock/g2data/tmp/imgk_C7nuQJ" )
2>/home/apeacock/g2data/tmp/g2dbg0SdyJ0

There is a quality flag, but it isn't being passed anything. I tested this on another file manually and it does in fact reduce a jpeg to a 0 quality one, which, needless to say, looks bad.

----

Gallery URL (optional): http://thepeacock.net/gallery
Gallery version: CVS
Webserver (with version): Apache/1.3.31
Datatabase (with version): MySQL 4.0.23
PHP version (eg 4.2.1): PHP 4.3.10 (cgi)
phpinfo URL (optional):http://thepeacock.net/misc/info.php
Graphics Toolkit(s): Imagemagick, Netpbm, gd
Operating system: Linux 2.4.29
Web browser/version: Firefox 1.0.1
G1 version (for migration bugs): n/a

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2005-03-08 17:46

i've never heard of this before.. what quality setting is selected in Site Admin / Imagemagick ?

 
apeacock

Joined: 2005-03-08
Posts: 14
Posted: Tue, 2005-03-08 18:03

I can't find any settings for imagemagick, that was the first thing I looked for. The only place I see imagemagick mentioned is under toolkit priority, where I can just move them up and down, and under modules, where I can just activate/deactivate it (if I deactivate cetian modules they can't reactivate, but thats a question for another time...)

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2005-03-08 18:24

in Site Admin you should see

Quote:
Graphics Toolkits

* Ffmpeg
* ImageMagick
* NetPBM
* Toolkit Priority

on the left side if you have activated ffmpeg, imagemagick and netpbm modules. If there's no imagemagick link at the same time you get this "convert ..." message in debug mode, then something rather strange is going on.

Go to site admin -> modules and check if the imagemagick module is activated. maybe deactivate/remove and activate it again.
but in the imagemagick admin view, you should see a quality drop down list.

 
apeacock

Joined: 2005-03-08
Posts: 14
Posted: Tue, 2005-03-08 18:28

Nope, I don't have those under graphics toolkits. In the side menu I have

Quote:
Admin Options

* Gallery
o General
o Modules
o Users
o Groups
* Graphics Toolkits
o Toolkit Priority
* Display
o Layouts and Themes

Navigation

* Back to album

If I deactivate imagemagick, it probably won't reactivate (it wouldn't in beta 1).

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2005-03-08 18:34

I just have deactivated, uninstalled, installed and activated again the imagemagick G2 module.
Try it, if it doesn't work, activate debug and post the error. This will help us fix this error. And you have to do something anyway :)

 
apeacock

Joined: 2005-03-08
Posts: 14
Posted: Tue, 2005-03-08 18:41

The deactivation was successful, install errored.

Also, something seems pretty wrong - in my modules, I have a green thumb-up, and a number in version, but under "installed", I have no versions for anything except core.

screenshot is available at http://www.thepeacock.net/misc/images/gallery.jpg

Error:

Error Detail -
Error (ERROR_STORAGE_FAILURE)

* in modules/core/classes/GalleryStorage/DatabaseStorage.class at line 1204 (gallerystatus::error)
* in modules/core/classes/GalleryStorage.class at line 261 (mysqldatabasestorage::addmapentry)
* in modules/core/classes/interfaces/GalleryPluginParameterMap.inc at line 98 (gallerystorage::addmapentry)
* in modules/core/classes/helpers/GalleryPluginHelper_medium.class at line 397 (gallerypluginparametermap::addmapentry)
* in modules/core/classes/helpers/GalleryPluginHelper_medium.class at line 347 (gallerypluginhelper_medium::_addparameter)
* in modules/core/classes/GalleryCoreApi.class at line 360 (gallerypluginhelper_medium::setparameter)
* in modules/core/classes/GalleryPlugin.class at line 284 (gallerycoreapi::setpluginparameter)
* in modules/imagemagick/module.inc at line 61 (imagemagickmodule::setparameter)
* in modules/core/classes/GalleryModule.class at line 137 (imagemagickmodule::upgrade)
* in modules/core/AdminModules.inc at line 68 (imagemagickmodule::installorupgrade)
* in main.php at line 166 (adminmodulescontroller::handlerequest)
* in main.php at line 46
* in main.php at line 39

System Information
Gallery version 2.0-beta-1
PHP version 4.3.10 cgi
Webserver Apache/1.3.31 (Unix) DAV/1.0.3 mod_gzip/1.3.26.1a PHP/4.3.10 mod_ssl/2.8.19 OpenSSL/0.9.6c
Database mysql 4.0.23a-log
Toolkits Gd, NetPBM
Operating system Linux ugh 2.4.29-grsec+w+fhs6b+gr0501+nfs+a32+++p4+sata+c4+gr2b-v6.189 #1 SMP Mon Feb 7 13:23:30 PST 2005 i686
Browser Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6) Gecko/20050225 Firefox/1.0.1
Gallery Debug Output

file_exists(/home/apeacock/g2data/cache/module/_all/0/0/GalleryFactoryHelper_loadRegistry.inc)
Unimplemented: GalleryUrlGenerator
file_exists(/home/apeacock/g2data/sessions/90f9e6225b0092579a2f0fcb75bbe419)
clearstatcache()
filesize(/home/apeacock/g2data/sessions/90f9e6225b0092579a2f0fcb75bbe419)
fopen(/home/apeacock/g2data/sessions/90f9e6225b0092579a2f0fcb75bbe419, rb,
0)
flock(Resource id #29, 6, )
fread(Resource id #29, 9352)
flock(Resource id #29, 3, )
fclose(Resource id #29)
file_exists(/home/apeacock/g2data/cache/module/core/0/0/0.inc)
Continuing navigation x84aa6c2d
file_exists(/home/.underfoot/apeacock/thepeacock.net/gallery/modules/core/classes/helpers/../../../../modules/core/module.inc)
realpath(/home/.underfoot/apeacock/thepeacock.net/gallery/modules/core/classes/../../..)
Binding text domain: modules_core ->
/home/.underfoot/apeacock/thepeacock.net/gallery/modules/core/locale
file_exists(/home/apeacock/g2data//versions.dat)
file(/home/apeacock/g2data//versions.dat, )
[1110307026] can't guarantee 5 -- extending!
file_exists(/home/apeacock/g2data/cache/entity/0/0/5.inc)
file_exists(/home/apeacock/g2data/cache/module/_all/0/0/GalleryPluginHelper_fetchPluginStatus.inc)
file_exists(/home/.underfoot/apeacock/thepeacock.net/gallery/modules/core/classes/../../../modules/core/AdminModules.inc)
file_exists(/home/.underfoot/apeacock/thepeacock.net/gallery/modules/core/classes/../../../modules/core/AdminModules.inc)

(mysql):
SELECT
g2_1_UserGroupMap.g_userId
FROM
g2_1_UserGroupMap
WHERE
g2_1_UserGroupMap.g_userId = 5
AND
g2_1_UserGroupMap.g_groupId = '2'
LIMIT 1

file_exists(/home/.underfoot/apeacock/thepeacock.net/gallery/modules/core/classes/helpers/../../../../modules/imagemagick/module.inc)
realpath(/home/.underfoot/apeacock/thepeacock.net/gallery/modules/core/classes/../../..)
Binding text domain: modules_imagemagick ->
/home/.underfoot/apeacock/thepeacock.net/gallery/modules/imagemagick/locale
file_exists(/home/apeacock/g2data/cache/module/imagemagick/0/0/0.inc)
file_exists(/home/.underfoot/apeacock/thepeacock.net/gallery/modules/core/classes/GalleryStorage/../../../../modules/imagemagick/classes/GalleryStorage/DatabaseStorage/schema/platform/mysql)

(mysql): SHOW TABLES

(mysql): SELECT g_name, g_major, g_minor FROM g2_1_Schema

mysql error: [1062: Duplicate entry 'module-imagemagick-0-path' for key 1]
in EXECUTE("INSERT INTO g2_1_PluginParameterMap (g_pluginType, g_pluginId,
g_itemId, g_parameterName, g_parameterValue) VALUES ('module',
'imagemagick', 0, 'path', '')")


(mysql): INSERT INTO g2_1_PluginParameterMap (g_pluginType, g_pluginId,
g_itemId, g_parameterName, g_parameterValue) VALUES ('module',
'imagemagick', 0, 'path', '')

1062: Duplicate entry 'module-imagemagick-0-path' for key 1

adodb_mysql._execute(INSERT INTO g2_1_PluginParameterMap
(g_pluginType, g_pluginId, g...) % line
818, file: adodb.inc.php

adodb_mysql.execute(INSERT
INTO g2_1_PluginParameterMap (g_pluginType, g_pluginId, g...,
Array[5]) % line 1201, file: DatabaseStorage.class

mysqldatabasestorage.addmapentry(GalleryPluginParameterMap,
Array[5]) % line 261, file: GalleryStorage.class

gallerystorage.addmapentry(GalleryPluginParameterMap,
Array[5]) % line 98, file: GalleryPluginParameterMap.inc
gallerypluginparametermap.addmapentry(Array[5]) % line 397, file: GalleryPluginHelper_medium.class

realpath(/home/.underfoot/apeacock/thepeacock.net/gallery/modules/core/classes/../../..)
realpath(/home/.underfoot/apeacock/thepeacock.net/gallery/modules/core/classes/../../../)

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2005-03-08 18:52

right, there are several things wrong in your installation.
yes, there should be versions number in the installed column.

did you uninstall imagemagick after deactivating it? when you uninstall it, it deletes all entries in the database corresponding to imagemagick. then you should be able to install/activate it again. tell me, if you also see a number in the installed column when you accomplished this.

what can you tell us about the "history" of this G2 install? did you have another G2 installed before? was it an upgrade? if not, did you empty g2data / db and delete all files before you installed this G2?

 
apeacock

Joined: 2005-03-08
Posts: 14
Posted: Tue, 2005-03-08 18:58

Uninstall it? I pressed deactivate, and then I get an install button. No button for uninstall.

This is a clean install. I had beta1 installed, but I deleted the directory and the data dir and used a different DB for this install.

Everything seemed to go fine... the only thing I'm thinking of is that I have a funky home directory setup on dreamhost - both /home/apeacock and /home/.underfoot/apeacock work, and I'm not sure what I put in for my home dir during install. g2data is also stored in /home/apeacock/g2data, while the gallery is in /home/apeacock/thepeacock.net/gallery.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2005-03-08 18:59

1) deactivate all toolkits (ffmpeg, im, netpbm, gd, also squarethumbs, thumbnail and uploadarchive which technically are toolkits)
2) delete the contents of g2_TkOperatnMap and g2_TkOperatnMimeTypeMap in your db

now you should be able to install/activate the toolkits again.
if you can figure out how to reproduce this problem (you deactivate a toolkit but it still shows up in Toolkit Priority) from a clean install please let us know.. one other person saw this too.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2005-03-08 19:03

if you don't see a uninstall link after deactivating a module and if you are database savvy enough, delete all entries in g2_1_PluginParameterMap corresponding to this module.
i.e. delete from g2_1_PluginParameterMap
where g_pluginId = 'imagemagick';

 
apeacock

Joined: 2005-03-08
Posts: 14
Posted: Tue, 2005-03-08 19:09

Mindless: I did that and it didn't work. I didn't uninstall, since after I deactivate I do not have a button or anything anywhere to uninstall, just a button to instal.

 
apeacock

Joined: 2005-03-08
Posts: 14
Posted: Tue, 2005-03-08 19:14

Valiant: I did that, and I finally have that option, with a value of 75 in the quality, and my image uploads finally work. Thank you.

I seem to have this problem with all my modules though - they say they're installed, but they're not working, like the upload applet. Any idea what is wrong?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2005-03-08 19:37

there must have been something seriously going wrong during the installation of your G2. do the same what you did for the imagemagickmodule for all other modules that are installed but have no version number in the installed column.
procedure:
foreach module that is active but has no version nr in installed column do
- deactivate
- sql command: delete from g2_1_PluginParameterMap
where g_pluginId = 'modulename';
whereas modulename = the name of the module you are uninstalling.

then install/activate the modules again.

 
apeacock

Joined: 2005-03-08
Posts: 14
Posted: Tue, 2005-03-08 19:47

Thank you, what I ended up doing was deactivating all of them and clearing the whole table, then putting the modules I want back on.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2005-03-08 20:51

hopefully you didn't just delete ALL entries in the table, because some of them were for the core module, which cannot be installed manually in site admin.