[BETA] Image Cacher 0.8.0

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Swizec
Former Team Member
Posts: 1701
Joined: Mon Mar 10, 2003 9:42 pm
Location: Slovenia
Contact:

Post by Swizec »

it's still the full image, just that it's local, thus really faster, the download goes with the same speed as the topic status images you have...

you can check this mod, that helps smallify the downloads
BinB
Registered User
Posts: 28
Joined: Sat Mar 26, 2005 11:27 pm

Post by BinB »

OK, I'll look into that one too, but from what I'm reading in the translation that still just resizes the image after download. I'll look closer at the code.

Ideally a mod could be made that created small thumbnails of all images located in the img tags and stored the thumbnails locally while leaving the fullsize file elsewhere....

I better sketch that thought process out more before I blather about inserting wormholes or something.....
Swizec
Former Team Member
Posts: 1701
Joined: Mon Mar 10, 2003 9:42 pm
Location: Slovenia
Contact:

Post by Swizec »

what you want is easy, and I think that guy is doing it, alteast thats how he's explaining it

the only thing with doing that is eating a whole bunch of processor time
BinB
Registered User
Posts: 28
Joined: Sat Mar 26, 2005 11:27 pm

Post by BinB »

But only the first time ideally....It's a catch 22 I guess.

If he's doing that for EVERY load, GD will kill my processor time. If we could get your Cache mod to cache thumbnails rather than full images, that would be great, but I'm seeing lots of hurdles to accomplish that.

I think we're going to be stuck with images ON or Images OFF to make our dial up users happy....

Thanks again!
Swizec
Former Team Member
Posts: 1701
Joined: Mon Mar 10, 2003 9:42 pm
Location: Slovenia
Contact:

Post by Swizec »

you could get my cache mod cache and display thumbnails, I think

I'll give the instructions, just gotta watch this movie first :D
Swizec
Former Team Member
Posts: 1701
Joined: Mon Mar 10, 2003 9:42 pm
Location: Slovenia
Contact:

Post by Swizec »

there you go, a tweaking to make this mod store play around with thumbnails (untested)

Code: Select all

install both the image cacher and the post max image size mod
be sure to install the cacher first!

then do:

# 
#-----[ OPEN ]------------------------------------------ 
# 


functions_cache.php

# 
#-----[ FIND ]------------------------------------------ 
# 

$im2 = imagecreatetruecolor( $w, $h + 20 );

# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 

$newwidth = $board_config[ 'postimg_width' ];
$newheight = $board_config[ 'postimg_height' ];

if($w > $h && $newheight < $h){
	$newheight = $h / ($w / $newwidth);
} else if ($w < $h && $newwidth < $width) {
	$newwidth = $w / ($h / $newheight);    
} else {
	$newwidth = $w;
	$newheight = $h;
}

$im2 = imagecreatetruecolor( $newwwidth, $newheight + 20 );

# 
#-----[ FIND ]------------------------------------------ 
# 


imagecopy( $im2, $im1, 0, 0, 0, 0, $w, $h );

# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 

imagecopyresized($im2, $im1, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);


and there you go, a thumbnail caching thingo that then shows thumbnails
and if you wait for me to "release" the image cacher 0.8.0 the thumbnails 
will link to the original image

edit: on the second thought, this is a good idea, I'll be adding this to version 0.8.0
Swizec
Former Team Member
Posts: 1701
Joined: Mon Mar 10, 2003 9:42 pm
Location: Slovenia
Contact:

Post by Swizec »

version 0.8.0 is now here

wanted to make the demo, but managed to mess up my demo board because of mod clashes, probably

I will be recreating that thing on Sunday :)
Swizec
Former Team Member
Posts: 1701
Joined: Mon Mar 10, 2003 9:42 pm
Location: Slovenia
Contact:

Post by Swizec »

the demo is now up, please have a looksee and find me bugs :d

I've already discovered that the ftp support doesn't really work that well, will be fixing it :)

if anyone has the time to put this through EM and test on some ftp I would be most grateful, coz it could just be me and my settings causing a problem
Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 28619
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Post by Paul »

BinB wrote: But only the first time ideally....It's a catch 22 I guess.

If he's doing that for EVERY load, GD will kill my processor time. If we could get your Cache mod to cache thumbnails rather than full images, that would be great, but I'm seeing lots of hurdles to accomplish that.

I think we're going to be stuck with images ON or Images OFF to make our dial up users happy....

Thanks again!

You mean my mod? It haves at the newest version(0.0.3) also a image cache :D
MIS-ONE
Registered User
Posts: 82
Joined: Tue Dec 24, 2002 9:21 pm

Post by MIS-ONE »

I just installed the new version and am not having any luck with it caching images anymore. The first worked, did any code from your first release need to be removed?

I'm also getting this error "Cache could not be created on device."

That's the only thing I have to work with in terms of why this isn't working anymore.

Any ideas?? THanks!
Swizec
Former Team Member
Posts: 1701
Joined: Mon Mar 10, 2003 9:42 pm
Location: Slovenia
Contact:

Post by Swizec »

I don't really know jif any code had to be removed, I mostly use included files so...

what kinda access are you using?

this sounds to em liek permissions issues, for me it worked by simply chmodding the cache to 777
A.I. BOT
Registered User
Posts: 1848
Joined: Thu Apr 17, 2003 11:43 pm
Location: Newfoundland, Canada
Contact:

Post by A.I. BOT »

nice mod man cant wait until it hits RC ;)
MIS-ONE
Registered User
Posts: 82
Joined: Tue Dec 24, 2002 9:21 pm

Post by MIS-ONE »

Swizec wrote: I don't really know jif any code had to be removed, I mostly use included files so...

what kinda access are you using?

this sounds to em liek permissions issues, for me it worked by simply chmodding the cache to 777


Permissions are set at 777, I'm not using the ftp access, same as I did before. I uploaded your new files over the old ones and made the changes in your documentation. The old cached files load up, but new files won't cache, then I get this in the ACP:

Warnings
Currently no problems with cache

Image cache browser
Cache could not be created on device.
Sp-Am
Registered User
Posts: 38
Joined: Sat May 15, 2004 4:51 am

Post by Sp-Am »

I just tested out the MOD on your test forum and I noticed that if you post a broken image, there will be an error on posting.php

Is there a fix for this?
Swizec
Former Team Member
Posts: 1701
Joined: Mon Mar 10, 2003 9:42 pm
Location: Slovenia
Contact:

Post by Swizec »

mis-one: try resyncing the cache and if it doesn't helpt go through the .mod file and see if any code did get changed coz I really can't remember :)

sp-am: could you please paste the error message?
Post Reply

Return to “[2.0.x] MODs in Development”