TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

July 20, 2024, 07:58:46 PM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,333
  • Total Topics: 21,233
  • Online today: 133
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 1
  • Guests: 75
  • Total: 76
  • @rjen

Downloads thumbnails

Started by emanuele, August 14, 2012, 09:55:33 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

emanuele

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! :)

IchBin

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

emanuele

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*

IchBin

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.

emanuele

The one highlighted:


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

IchBin

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.

emanuele

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

IchBin

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