Error with many pictures ...

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
Lux
Regular
Posts: 764
Joined: Fri Aug 12, 2005 4:36 pm
Location: Grüt, Zürich, Switzerland
Contact:

Error with many pictures ...

Post by Lux »

Hi,

months ago, I copied a gallery of free pictures to my serendipity installation. Over time some pictures were added to the media database. When I now try to update the preview, I get a

Code: Select all

Fatal error: Allowed memory size of 20971520 bytes exhausted (tried to allocate 24 bytes) in /srv/www/deimeke.net/dirk/blog/include/db/mysql.inc.php on line 135
I think it is a php setting. Which value do I have to increase to get rid of the message?

Second: How can I find out which pictures (of some thousand) are used in my blog?

Thanks for your support

Dirk
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Error with many pictures ...

Post by garvinhicking »

Hi!

This can happen if the automatic media synchronisation of s9y is executed and needs to parse all pictures inside your directory tree. This might require a lot of RAM, depending on your picture files.

You can increase the php.ini setting "memory_limit" to get rid of that. Remember to restart apache if you change it to be sure that it gets applied.
Second: How can I find out which pictures (of some thousand) are used in my blog?
S9y offers a way to track referenced images. But you would need to have used that before -- it will not work if you enable that now.

So the only way for you is to check your serendipipity_entries DB table and see which images you linked to. You could automate that with a small PHP script that matches all your <img> links and looks them up if they match in the DB...

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Lux
Regular
Posts: 764
Joined: Fri Aug 12, 2005 4:36 pm
Location: Grüt, Zürich, Switzerland
Contact:

Re: Error with many pictures ...

Post by Lux »

Hey,

that is fast response.
garvinhicking wrote:You can increase the php.ini setting "memory_limit" to get rid of that. Remember to restart apache if you change it to be sure that it gets applied.
Ok. Thanks for that.
garvinhicking wrote:S9y offers a way to track referenced images. But you would need to have used that before -- it will not work if you enable that now.
What do I have to enable for a new blog?
garvinhicking wrote:So the only way for you is to check your serendipipity_entries DB table and see which images you linked to. You could automate that with a small PHP script that matches all your <img> links and looks them up if they match in the DB...
Ok. Perfect. That is what I thought about too.

I am better in Perl, so I will write a perl script.

Is there any tool section, where I can upload it? Just to five others the chance to do the same.

Dirk
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Error with many pictures ...

Post by garvinhicking »

Hi!
What do I have to enable for a new blog?
That's quite complex and too lengthy to write up here. But I've written it all up in my book.... :-)
Is there any tool section, where I can upload it? Just to five others the chance to do the same.
I'd propose to paste the script here? And I could then link to it from the FAQ section on s9y.org?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Lux
Regular
Posts: 764
Joined: Fri Aug 12, 2005 4:36 pm
Location: Grüt, Zürich, Switzerland
Contact:

Re: Error with many pictures ...

Post by Lux »

garvinhicking wrote:That's quite complex and too lengthy to write up here. But I've written it all up in my book.... :-)
Then I will find it. Just two books in between ...
garvinhicking wrote:I'd propose to paste the script here? And I could then link to it from the FAQ section on s9y.org?
Will do!

Dirk
Lux
Regular
Posts: 764
Joined: Fri Aug 12, 2005 4:36 pm
Location: Grüt, Zürich, Switzerland
Contact:

Post by Lux »

Question: Does s9y use relative paths everytime?

Cheers

Dirk
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!
Lux wrote:Question: Does s9y use relative paths everytime?
s9y generally does not prepend the HTTP hostname. You'll be safe if you preg_match to .*uploaddir/picture.jpg.* :)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Lux
Regular
Posts: 764
Joined: Fri Aug 12, 2005 4:36 pm
Location: Grüt, Zürich, Switzerland
Contact:

Post by Lux »

garvinhicking wrote:s9y generally does not prepend the HTTP hostname. You'll be safe if you preg_match to .*uploaddir/picture.jpg.* :)
Perfect, that makes it much easier.

Will continue the script next weekend.

Thanks

Dirk
Post Reply