Center text on image

See all posts See thread Reply

Re: Center text on image new!
by Vincent, 17 years, 7 months ago
Getting the dimensions and size IS possible :)

Work around:
$imgsize = getimagesize($_FILES['file']['tmp_name']);
$image_uploaded->image_text =
  $imgsize[0].'x'.$imgsize[1].'px - '.
  $image_sizekB.'kB\nHosted by site.com';
Reply
Re: Center text on image new!
by colin, 17 years, 7 months ago
Of course, I know that. Look at the code of the class!

What I meant is that when you us the class text features to add some text, it is not possible so far to print the dimensions of the image in the text. The text that you set in $foo->image_text is printed as it is (i.e. not parsed), nor any keyword is replaced with the actual dimensions.

So you hint that your code could be used to set the text prior to calling the Process() function. But this wouldn't work, as of now, because you don't know the dimensions the image will be in after being resized.

I will add such a feature in the next release. You will then be able to use keywords in $foo->image_text, such as [x], [y] or even [date].Reply