News: February 16th, 2020, The Tinyportal team is pleased to announce the release of ~~ TinyPortal 1.6.5! GET IT NOW!!!

Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media
Welcome, Guest. Please login or register.
Did you miss your activation email?

February 28, 2020, 04:41:47 AM

Login with username, password and session length

Recent

Members
Stats
  • Total Posts: 189516
  • Total Topics: 20802
  • Online Today: 108
  • Online Ever: 917
  • (January 21, 2020, 09:02:26 AM)
Users Online
Users: 0
Guests: 107
Total: 107

Author Topic: Downloads thumbnails  (Read 6676 times)

0 Members and 1 Guest are viewing this topic.

Offline emanuele

  • Jr. Member
  • **
  • Posts: 17
Downloads thumbnails
« on: August 14, 2012, 02: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! :)

Offline IchBin™

  • Developer
  • *
  • Posts: 16228
    • My Website
Re: Downloads thumbnails
« Reply #1 on: August 14, 2012, 09:05:58 AM »
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

Offline emanuele

  • Jr. Member
  • **
  • Posts: 17
Re: Downloads thumbnails
« Reply #2 on: August 14, 2012, 10:40:59 AM »
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...

* emanuele feels is looking in the wrong place...
But I can't find any other to look at... *headscratch*

Offline IchBin™

  • Developer
  • *
  • Posts: 16228
    • My Website
Re: Downloads thumbnails
« Reply #3 on: August 14, 2012, 01: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.

Offline emanuele

  • Jr. Member
  • **
  • Posts: 17
Re: Downloads thumbnails
« Reply #4 on: August 15, 2012, 06:06:11 AM »
The one highlighted:


* emanuele is too lazy to properly highlight it... :P

Offline IchBin™

  • Developer
  • *
  • Posts: 16228
    • My Website
Re: Downloads thumbnails
« Reply #5 on: August 15, 2012, 12: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.

Offline emanuele

  • Jr. Member
  • **
  • Posts: 17
Re: Downloads thumbnails
« Reply #6 on: August 15, 2012, 02: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

Offline IchBin™

  • Developer
  • *
  • Posts: 16228
    • My Website
Re: Downloads thumbnails
« Reply #7 on: August 15, 2012, 03: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