TinyPortal

Development => Resources => Modules => Topic started by: emanuele on August 14, 2012, 09:55:33 AM

Title: Downloads thumbnails
Post by: emanuele on August 14, 2012, 09:55:33 AM
Hi all! :)

I'm not sure if I'm misinterpreting something or missing something, so here I am asking for support! O:)

I'm using TP 1.0, in the page ?action=tpmod;dl=adminsettings there is a series of options "Resize screenshot sizes".
So, I expect that if I go to TinyPortal > Downloads > upload and I upload an image this should be resized to these three sizes, but uploading any image this just go to the tp-downloads directory and is not resized.

So, first question: did I understand correctly or am I just plain wrong?
I've seen several calls to tp_createthumb, but I'm not sure from which form I can catch them.
My goal is simply to have a thumb (or maybe 2), so could you please suggest me how to get these three thumbs or would you point me to the code that uploads the files from the "upload" page (I get lost in following TP POSTs... :P) so that I can add the code to create the thumbs?

Thank you very much! :)
Title: Re: Downloads thumbnails
Post by: IchBin on August 14, 2012, 04:05:58 PM
If I recall correctly, when you upload an image in the downloads section (in the new image section where it says "Upload a new picture (the existing will be replaced)") it creates 4 images. Places each image in a different directory too. I do not think TP does any image editing when you put an image as the download.

../tp-images/dlmanager/single/<-- main 800x800 image goes here
../tp-images/dlmanager/listing/ <-- medium 200x200sized
../tp-images/dlmanager/thumb/ <-- thumb 80x80 goes here
../tp-images/dlmanager/ <-- unedited image goes here "I think". lol
Title: Re: Downloads thumbnails
Post by: emanuele on August 14, 2012, 05:40:59 PM
That's what I though while reading the code, but when I try to upload a file it goes tp-downloads/ and no thumbs are created...

/me feels is looking in the wrong place...
But I can't find any other to look at... *headscratch*
Title: Re: Downloads thumbnails
Post by: IchBin on August 14, 2012, 08:28:08 PM
Just to clarify, are you uploading the picture as the download? Or are you uploading the picture as a screenshot for the download? There are two different places in the upload page. One is for the actual download, and the other further down at the bottom of the page is for the additional picture screenshot.
Title: Re: Downloads thumbnails
Post by: emanuele on August 15, 2012, 01:06:11 PM
The one highlighted:
(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fimg15.imageshack.us%2Fimg15%2F8020%2Fscreen77p.th.png&hash=dac63978047e2aa438ec840a6d045a1ec752cbcd) (http://img15.imageshack.us/i/screen77p.png/)

/me is too lazy to properly highlight it... :P
Title: Re: Downloads thumbnails
Post by: IchBin on August 15, 2012, 07:37:29 PM
Nope that one does not. That is simply the one that creates the download. The one at the bottom of your screenshot where it says "Addictional picture" is the one that will create the thumb images as I described.
Title: Re: Downloads thumbnails
Post by: emanuele on August 15, 2012, 09:48:27 PM
AAAHHHH!!!!

I knew I was missing something! :P

Okay...now I have only to find where the upload is "created" and hack in a thumbnail (better if linked to the saved sizes. >:D

Thanks Ich! ;D
Title: Re: Downloads thumbnails
Post by: IchBin on August 15, 2012, 10:46:18 PM
haha, no problem. TBH, most times around here I end up having to look to see how it works exactly, even after all these years.lol But I just happen to know this one because of a security exploit that I had to fix where uploads weren't properly sanitized and were executable in the directory they were in. :o