vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How to determine the dimensions of a thumbnail? (https://vborg.vbsupport.ru/showthread.php?t=77000)

tgmorris 02-25-2005 02:49 AM

How to determine the dimensions of a thumbnail?
 
I'd like to be to figure out what the actual thumbnail dimensions are for some processing purposes. I can obtain the thumbnail - how do I know what the actual width and height are?

deathemperor 02-25-2005 04:01 AM

use php function getimagesize(), for more info: php.net

tgmorris 02-25-2005 04:35 AM

Quote:

Originally Posted by deathemperor
use php function getimagesize(), for more info: php.net

I've tried that. The thumbnails are stored in theh DB so to access them it uses attachment.php?attachmentid=41&stc=1&thumb=1. The problem is that it returns the size for the fullsize image and not the thumbnail. Pointing directly to the thumbnail doesn't work.

I can load the thumbnail directly from the DB and did find imagesx and imagesy. These work on in memory images however they come with an error of

Warning: imagesx(): supplied argument is not a valid Image resource

EDIT: Nevermind. I found the solution. I had to use imagecreatefromfile() to create the resource that imagesx uses.

dwh 06-07-2005 09:15 PM

The funny thing is, when I create a straight php file and run getimagesize on attachments to get size info, it works fine. But put it into vb's task manager causes it to not return width or height. I can't figure out why.


All times are GMT. The time now is 05:54 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00923 seconds
  • Memory Usage 1,712KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete