Gossamer Forum
Quote Reply
Image update
I have my automatic thumbnail working again. It thumbnails to a pre-set size, and stores the images in a default filelocation and filelocation/thumbnails

It also resizes, arbitrarily rotates, adds an arbitrary border and drop shadow if requested.

I also have recovered the mod that allowed me to show of my images galleries in a "slide" format, with two variants. One uses arbitrary slide-like format, but if images are different sizes, so are the slides. The other uses a multiple row, parallel processing format, so if images are different sizes, all rows are adjusted to the same size. (Width can be set by an invisible 1pixel image).

It also adds missing cells so the format stays even.

I shoud have a demo version of postcards.com up that randomly switches between the two formats, and since I use a uniform-width format for my thumbnails, you can see how it operates. (My thumbnails are 140 pixels wide, the height varies depending on vertical or horizontal formats).


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Image update In reply to
To see a minor demo of it you can check:

http://betterbeads.com/...QL/test_upload_2.cgi

I've recovered the image processing, automatic thumbnailing, rotation, drop shadows, margins, and parts of the slide-view.

To see the slide view:

http://postcards.com/.../DP_Test/page.cgi?d1

.... and view the categories. The little 1/0 in the upper left corner tells you which template format it's using, and it's picked randomly for the demo.

Funny, how a day or so after I mentioned in a public post about Image Folio, they came out with an all new version 3, that has addressed some (not all) of the issues....

Oh.. and these are using the netpbm libraries, and Image::Size, not anything heavy duty like Image::Magick

Actually, I'm only using a few of the netpbm tools, with significant room to expand.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Image update In reply to
>>
Funny, how a day or so after I mentioned in a public post about Image Folio, they came out with an all new version 3, that has addressed some (not all) of the issues....
<<

Its probably all down to your post Wink

You might need to add some sort of size checking to your upload script otherwise my 130MB zipped version of the eminem show might make it onto your server Laugh

You should probably disallow anything other than images too.

Last edited by:

Paul: Sep 10, 2002, 7:16 AM
Quote Reply
Re: [Paul] Image update In reply to
Try uploading something large ;)

Unfortunately, there is no way to check size BEFORE upload. There is also no way to interupt the filestream as it's being uploaded. I'd asked Alex about this before.

I've been trying to figure out a way to do that.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Image update In reply to
>>
There is also no way to interupt the filestream as it's being uploaded. I'd asked Alex about this before.
<<

I've done this is one of my scripts. Instead of uploading the whole file before deciding if it is too big, I do:

Code:
# Read the file.
while (($content = read($sys, $buffer, 2048))) {
if ($file_size > ($CFG->{max_attachment_size} * 1000)) {
$file_size = -1;
last;
}
$file_body .= $buffer;
$file_size += $content;
}

...then I just check the file size...if it is -1 it was too big, but because of the last; it doesn't keep uploading.

Last edited by:

Paul: Sep 10, 2002, 12:09 PM
Quote Reply
Re: [pugdog] Image update In reply to
>>
Unfortunately, there is no way to check size BEFORE upload.
<<

You can, but its IE only.

http://gossamer-threads.com/...ment;postatt_id=494;
Quote Reply
Re: [Paul] Image update In reply to
Code:

# Read the file.
while (($content = read($sys, $buffer, 2048))) {
if ($file_size > ($CFG->{max_attachment_size} * 1000)) {
$file_size = -1;
last;
}
$file_body .= $buffer;
$file_size += $content;
}


I had tried something similar, but I couldn't get it to work. The problem I think is that the file is being uploaded into the buffer before any of this really occurs. Maybe, if the file is really big -- like 130 meg, the buffer will be read, and the process killed off before it finishes, but I have a feeling that no matter what, megs, even hundreds of megs, can be uploaded as long as the web server is willing to deal with it.

This seems to be something that has to be set in the web server. The webserver is managing the process, and the I/O stream, but there doesn't seem to be a way to stop it "mid stream" so to speak.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [Paul] Image update In reply to
Quote:
>>
Unfortunately, there is no way to check size BEFORE upload.
<<

You can, but its IE only.


I'm sure any malicious hacker will have the frame of mind to use MSIE, vs one of the other browsers where he can hack through the code .... ?? ;)


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Image update In reply to
Im not sure, but it seemed to work when I tested...i set the size limit to a few kb and tried to upload a large file and the error appeared almost immediately....this was on WinXP.

I may try on linux over the next few days and see what happens.

Last edited by:

Paul: Sep 10, 2002, 1:17 PM
Quote Reply
Re: [Paul] Image update In reply to
Under windows, it might work differently. Windows has always been much more concerned with something like that.

I just went to the apache site, and found the reference to

http://httpd.apache.org/.../Apache-Request.html

But I'm not sure how this would end up being compiled or flagged in the server control files. Then, I might be looking in the wrong place too. This might be for something totally un related :)


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Image update In reply to
I was looking for old releases, and noticed the link I posted here was bad:

http://postcards.com/...DP_Test/page.cgi?d=1

is the correct one (I left out the =).

This shows the slide display, but the templates are off, and don't link to the proper jump. This is just a "visual" look to one of the template sets the image gallery will handle.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.