Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2010-01-07 01:24:59

korpulente
Member
Registered: 2009-01-29
Posts: 36

Re: image thumbnails error

I tried dropping the table, and recreating it like this:

CREATE TABLE `txp_image` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(255) NOT NULL default '',
  `category` varchar(255) NOT NULL default '',
  `ext` varchar(20) NOT NULL default '',
  `w` int(8) NOT NULL default '0',
  `h` int(8) NOT NULL default '0',
  `alt` varchar(255) NOT NULL default '',
  `caption` text NOT NULL,
  `date` datetime NOT NULL default '0000-00-00 00:00:00',
  `author` varchar(255) NOT NULL default '',
  `thumbnail` int(2) NOT NULL default '0',
  `thumb_w` int(8) NOT NULL default '0',
  `thumb_h` int(8) NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `author_idx` (`author`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 PACK_KEYS=0 AUTO_INCREMENT=3 ;

So far so good. Then I tried inserting the image values, like this:

INSERT INTO `txp_image` VALUES (1, 'divider.gif', 'site-design', '.gif', 400, 1, '', '', '2005-07-22 16:37:11', 'yourmom', 0);

This fails however. I get the following error: #1136 – Column count doesn’t match value count at row 1

What am I doing wrong?

Last edited by korpulente (2010-01-07 01:25:26)

Offline

#14 2010-01-07 01:30:18

korpulente
Member
Registered: 2009-01-29
Posts: 36

Re: image thumbnails error

Darn it! Looks like all my insert values are corrupt, as they lack dimensions for the thumbnails.

They’re exported recently from a live site, so something is obviously wrong on that one, but how can I fix it? Can I give them “default” values (width and height), without making a mess?

Edit:

Something like this works fine — it matches all columns — but will it mess up the site?

INSERT INTO `txp_image` VALUES (1, 'divider.gif', 'site-design', '.gif', 400, 1, '', '', '2005-07-22 16:37:11', 'yourmom', 0, '', '');

Last edited by korpulente (2010-01-07 01:33:07)

Offline

#15 2010-01-07 01:43:55

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

Re: image thumbnails error

when i export my tables i check off the box that says something like “create drop table”. it’s always unchecked. then when i import the table, i uncheck the box that says “allow interuptions”. then when it’s done writing i just get a green check mark. when i see messages like what you’ve posted above i feel like i’ve done it wrong.

however in the image above, you don’t even have these tables present. i’m stumped.

Last edited by mrtunes (2010-01-07 01:45:17)

Offline

#16 2010-01-07 01:49:05

korpulente
Member
Registered: 2009-01-29
Posts: 36

Re: image thumbnails error

I worked it out. Manipulating all the insert strings like the above, with empty thumb_w and thumb_h values did the trick. I’m guessing they weren’t needed as the thumbnail files were intact, ie. 4t.jpg.

Thanks for helping me out! :)

Offline

#17 2010-01-07 16:14:02

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: image thumbnails error

korpulente wrote:

The txp_image table doesn’t have any image_w or image_h columns. However there are a thumb_w and thumb_h column in txp_prefs…

My mistake; the new columns are thumb_w and thumb_h. (The columns for the main image size are simply h and w.)

Glad you’ve worked it out. If you want correct thumb dimensions for the old images check out http://ipsedixit.net/txp/91/soo_thumb_atts.


Code is topiary

Offline

Board footer

Powered by FluxBB