Anguz Posted May 9, 2003 Posted May 9, 2003 this code generates a name for the resampled picture based on the width and height of the pic: // Name for the resampled image (always JPEG for decent results in size and quality $newName = eregi_replace( '.([a-z]{3,4})', "-{$width}x{$height}.jpg", $src ); my question is: wouldn't this two pictures with the same size generate the same value for $newName? if so, how could it be fixed? Quote
radders Posted May 9, 2003 Posted May 9, 2003 Only if you have two different pictures with the same name to start with. I don't see how that could be. Quote
radders Posted May 9, 2003 Posted May 9, 2003 What this function does is to generate a new file name from any existing file name with a 3 or 4 letter extension (the character matches any length of string). The new fie name is created by the replacement of the original extension by the size and the extension jpg eg. if width=80 and height=100 and filename=myimage.jpg resultant filename is: myimage-80x100.jpg Quote
Anguz Posted May 10, 2003 Author Posted May 10, 2003 aaah! I see!! I thought it replace the whole name with the dimensions... forgive my ignorance hehe.. I still don't understand some code very well thank you very much for your help :) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.