473,395 Members | 1,885 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Problems using exif_thumbnail() to create thumbnail image

PHP 4.3.2 with --enable-exif

I have the following class:

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. class ThumbGenerator extends MethodGeneratorForActionPerformer {
  4.  
  5. function ThumbGenerator() {      // CONSTRUCTOR
  6. // DO ALL KINDS OF STUFF HERE
  7. }
  8.  
  9. /**
  10. * This method can only be used if you are using PHP version 4.3+
  11. and if you have TIFF or JPEG image
  12. *
  13. * @access private
  14. */
  15. function generateTIFFJPEGThumb() {                            //
  16. VOID METHOD
  17. global $section, $thumbLocationPath;
  18. /*------------------------------------------------------------------------------------------------------------------------------------------
  19. Because of the different methodologies of each method, the
  20. constructor must be called, thus, the class object
  21. must be initiated.  If "$this" does not exist, trigger an
  22. error
  23. -------------------------------------------------------------------------------------------------------------------------------------------*/
  24. if (!$this || !is_object($this)) trigger_error('You must first
  25. instantiate a ThumbGenerator object to use this method',
  26. E_USER_ERROR);
  27.  
  28. // STREAM FILE EMBEDDED THUMBNAIL CONTENTS INTO BINARY STRING
  29. VARIABLE
  30. if ($this->isSuccessful) {
  31. $thumbStreamObj = exif_thumbnail($this->locationPath . '/' .
  32. $this->fileName, $width, $height, $mimeTypeInt);
  33. print_r('<P>thumbStreamObj: '); print_r($thumbStreamObj);
  34. if (!$thumbStreamObj) {
  35. $this->isSuccessful = false;
  36. $this->setErrorArray(array('section' => 'Could not extract
  37. embedded thumbnail contents from "' . $this->locationPath . '/' .
  38. $this->fileName . '"'));
  39. }
  40. }
  41.  
  42. }
  43.  
  44. }
  45.  
  46. ?>
  47.  
The class is being used to literally generate a thumbnail from an
existing image. I read in the PHP manual (see
http://us3.php.net/manual/en/functio...-thumbnail.php ) that
exif_thumbnail() only extracts embedded thumbnail information from a
TIFF or JPEG
image. In knowing that I've simplified my method to only handle TIFF
or JPEG images (this is done in the class constructor - sorting out
what image type you got).

At this point, however, I am receiving nothing into the
$thumbStreamObj binary stream string variable; it's "empty" (false):

Expand|Select|Wrap|Line Numbers
  1. $thumbstreamObj = exif_thumbnail($this->locationPath . '/' .
  2. $this->fileName, $width, $height, $mimeTypeInt);
I checked the values of $this->fileName and $this->locationPath and
both contain the correct values to be able to locate the image in the
system for the function to extract the embedded thumbnail information
reportedly found in TIFF and JPEG images.

Has anyone had any luck using this to create a thumbnail? I could use
some more experted advice than I would think to find in the manual
notes, which I am certain I'll find among you gurus here.

Thanx
Phil
Jul 17 '05 #1
1 3616
so*****@erols.com (Phil Powell) wrote in message news:<1c**************************@posting.google. com>...
PHP 4.3.2 with --enable-exif

I have the following class:

[code]
<?php

class ThumbGenerator extends MethodGeneratorForActionPerformer {


<snip>

Not sure about your code. But, sometimes ago Mike Bradley, one of
the regular contributor of this group has written a thumbnail script
named gzImage.php But, unfortunately, now his site <gZenTools.com> is
down. I'm having a copy of his script Version 2.4 (not sure, if he has
released any new version). The script was much appreciated by the
regulars of this group. If you need that, you may contact me at my
email found at my sig-block.

--
| Just another PHP saint |
Email: rrjanbiah-at-Y!com
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Greg Scharlemann | last post by:
I am attempting to upload a picture to a webserver and create a thumbnail from the picture uploaded. The problem comes in when I attempt to create an Image object from the File object (which is...
3
by: Hitesh | last post by:
Hi, I am getting the response from another Website by using the HttpHandler in my current site. I am getting the page but all the images on that page are not appearing only placeholder are...
4
by: WStoreyII | last post by:
I am trying to make a listview that i will be using to display a group of pictures in a form. For some reason though the pictures come up horribly. I have a function that takes a image and...
6
by: Rich | last post by:
Hello, I want to simulate the dynamic thumbnail display of Windows Explorer (winxp) on a form or pannel container. If I place a picture box on my container form/pannel and dimension it to the...
4
by: John Swan | last post by:
Hello. I'm trying to create a simple program that amongst other things creates a thumbnail of an image (Bitmap) to a set size determined by the user in pixels? The problem is: All of the...
3
by: KimberlyM | last post by:
This has been driving me crazy. I hope someone can help. The site displays perfectly in FF but all div's do not show in IE. Please help me find the problem! Thanks! Here is my css. ...
3
by: Danny Ni | last post by:
Hi, I am looking for a way to display images with different aspect ratio into frames with fixed width and height, the problem is some images will look distorted if they are forced into fixed...
7
by: mishrarajesh44 | last post by:
hii all Truly telling i hav got this code from net & i am finding error while running the code below.. code:- <?php $idir = "photo/"; // Path To Images Directory $tdir =...
1
by: dodgeyb | last post by:
Hi there, Trying to allow client to upload image, thumbnail it, and save it into sql table image field. Code compiles & runs but image cannot be retrieved. any clues what I'm doing wrong pls ! ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.