473,851 Members | 2,167 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3660
so*****@erols.c om (Phil Powell) wrote in message news:<1c******* *************** ****@posting.go ogle.com>...
PHP 4.3.2 with --enable-exif

I have the following class:

[code]
<?php

class ThumbGenerator extends MethodGenerator ForActionPerfor mer {


<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.co m> 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
10845
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 the location of the uploaded picture)...I get the following error: java.lang.NoClassDefFoundError at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:130) at java.awt.Toolkit$2.run(Toolkit.java:712) at...
3
3098
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 displayed. Can anybody know this issue and help me to resolve this. In past i received the response saying that i should download the image first and then parse the actual response and modify the src attribute of the
4
1709
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 returns a thumbnail of it why are they working so bad? Also it works very slow how to make this quicker? Thanks WStoreyII
6
4763
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 size of a thumbnail and set the sizemode to Stretch -- I get one thumbnail. I want to retrieve all the picture files (jpg, bmp) in a directory into an array list and then display this list as thumbnails on my form dynamically. So my question is...
4
2580
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 examples I have seen so far are in c#. Can anyone please provide reference to a c++ managed version. Thanks. John
3
3331
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. .node-unpublished, .comment-unpublished { background-color : #594133; } .preview .node, .preview .comment { background-color : #ffffea; }
3
14123
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 frame due to differnt aspect ratio. Some graphic designer suggests me to keep the aspect ratio of the original graphic and pad the graphic with empty space to fit into the frame. One example, the fixed frame is 100x60 and the image is 120x120, I...
7
17064
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 = "photo/thumbs/"; // Path To Thumbnails Directory $twidth = "125"; // Maximum Width For Thumbnail Images
1
3150
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 ! Dim origImage As System.Drawing.Image = System.Drawing.Image.FromStream(FileUpload1.PostedFile.InputStream)
0
9748
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10670
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10356
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5736
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5934
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4549
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4143
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.