Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

ANDY - GalleryManagerGD cleanup deleted thumbnails

Quote Reply
ANDY - GalleryManagerGD cleanup deleted thumbnails
Hi Andy,

I wanted to resize thumbnails and when I clicked "Cleanup" it deleted a huge amount of thumbnails. The main images are still there but the thumbnails are gone. I'm currently trying to retore from server backup. Any ideas?

Thanks,

Mark

Last edited by:

MJB: Jul 6, 2020, 12:58 PM
Quote Reply
Re: [MJB] ANDY - GalleryManagerGD cleanup deleted thumbnails In reply to
Hi,

It's hard to know without seeing it running. From memory , it deletes the old thumbnails first, and then re-creates them (it was a very very long time ago I wrote this though :))

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [MJB] ANDY - GalleryManagerGD cleanup deleted thumbnails In reply to
Oh actually, looking at it no it doesn't delete the old images first. So you're sure it deleted them? If you run it from command line, do you get any errors coming up? (can't create images, etc)

Looking at the code all it does is run through all the images, and then re-build each of the images to the given sizes

BTW sorry I've only just replied to this. I very rarely check the forums now (as there is very little " action" on here, and as time doesn't really permit)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!

Last edited by:

Andy: Jul 14, 2020, 11:08 PM
Quote Reply
Re: [Andy] ANDY - GalleryManagerGD cleanup deleted thumbnails In reply to
Thanks for coming back. I don't know how to run from command line, I just clicked the Clean UP link in the plugin.

Not to worry, I managed to restore evertything from backup. I was looking to resize thumbnails to make them larger but I think it might have created new ones but the page refresh still pointed to the old ones.
Quote Reply
Re: [MJB] ANDY - GalleryManagerGD cleanup deleted thumbnails In reply to
Hi,

Weird - it shouldn't clean up any images (just re-make them, and add any new format sizes you added). To run from SSH, you would look at the URL in your admin panel - for example:

http://foo/cgi-bin/admin/admin.cgi?do=plugin&plugin=GalleryManager_GD&func=Cleanup

Then in SSH, run:

Code:
cd /path/to/cgi-bin/admin
perl admin.cgi '?do=plugin&plugin=GalleryManager_GD&func=Cleanup'

It may be:

Code:
perl admin.cgi 'do=plugin&plugin=GalleryManager_GD&func=Cleanup'

I can never remember if you include the ? or not =) (just make sure you backup your files are well, in case it doesn't do what you want)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] ANDY - GalleryManagerGD cleanup deleted thumbnails In reply to
OK it seams that some of my links have had the image renamed to 2 so I'm getting file '2' does not exist.

At t least with SSH I can see when it stops and find the image to replace.
Quote Reply
Re: [MJB] ANDY - GalleryManagerGD cleanup deleted thumbnails In reply to
Hi,

Can you send me SSH and GLinks logins so I can take a look? To me, it sounds like some of your File_URL's are wrong for the images (as thats how it builds up the URL). Also, please send me some examples that are breaking

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] ANDY - GalleryManagerGD cleanup deleted thumbnails In reply to
I've just done a full cleanup and it has completed. There were just 3 image files that it halted on out of 7,800 so I'm happy with that.
Quote Reply
Re: [MJB] ANDY - GalleryManagerGD cleanup deleted thumbnails In reply to
Ah cool. Yes that's not a bad number out of those :) some are probably historically broken files (corrupted), or something else has happened over time

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] ANDY - GalleryManagerGD cleanup deleted thumbnails In reply to
Just tried again via the Cleanup link in the browser and it got about half way and stopped. Went back to SSH and it completed so I don't know what that is but I'm happy it's work this way. I doubt I'll be doing it again any time soon it was just an update job to resize the thumbnails.

Thanks very much for your input it has been very useful.
Quote Reply
Re: [MJB] ANDY - GalleryManagerGD cleanup deleted thumbnails In reply to
It's possible it's just timing out (as it's not an nph script). Running from ash avoids that issue :)

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] ANDY - GalleryManagerGD cleanup deleted thumbnails In reply to
What i have done in the past in such situations:

1. Build a php-script and let it walk through the links.

or

2. Download all the pictures; use a batch resizer and do all the thumbnails new and upload them again.

I had both situations, depending on the situation.


At the moment i use a php-script to take files from the server, resize them, do the update to the links and move the file to the destination made by the links_files.id, if i remember right.


Code:
$query3 = "INSERT INTO bLinks_Files (ID, ForeignColName, ForeignColKey, File_Name, File_Directory, File_MimeType, File_Size, File_URL) VALUES
(NULL, 'b1', '$lid', '$fn', '/var/www/***/htdocs/***', '$imageMime', '$fileSize', '');
";
$result3 = $linkIS->prepare($query3);
$result3->execute();
$lastLid = $linkIS->lastInsertId();

and

Code:
$fn = "x.jpg";

$query32 = "
UPDATE bLinks_Files SET File_Name = '$fn' WHERE ID = '$lastLid';
UPDATE bLinks SET b1 = '$fn' WHERE bLinks.ID = '$lid';
";
$result32 = $linkIS->prepare($query32);
$result32->execute();

// last digit from lastLid
$dir = substr($lastLid,-1);

$finalfile = "/var/www/***/htdocs/***/" . $dir . "/" . $lastLid . "-" . $fn;
$i->writeImage($finalfile);