Image Extractor

Image extractor - plugin per wordpress


Image Extractor is a WordPress plugin that extract the first image from the post and display it. The "Image Extractor" main feature is the capability to resize the image found to a wanted size. The final image is cached in a folder, so you can obtain better performances.

How to install

  • Download the .zip file and extract it
  • Upload the extrated folder (imageExtractor/) to the WordPress plugins folder (wp-content/plugins/)
  • Configure the imageExtractor.php file and set the right cache folder. Make sure it’s writable.
  • Activate the plugin from the WordPress back office panel

How to use

Image Extractor will enable a new template function. It output a complete IMG tag to be inserted into your HTML code. The image source is retrieved from the first image found in the current post. Here is an example showing you how to use it:

<?php
  while (have_posts()) : the_post();
    image_extractor(true, 1, 395, 0, '', '', '<div>', '</div>');
    the_excerpt();
  endwhile;
?>

The syntax is:

  image_extractor($resize=false, $resize_type=1, $width='', $height='', $class='', $id='', $prefix='', $suffix='')

where:

  • resize: indicate if the plugin has to resize the image and store it in the cache folder
  • resize_type: there are 3 type of resizing:
    • 0 -> image will be resized to the new output size, regardless of the original aspectratio. (default)
    • 1 -> image will be cropped if necessary to preserve the aspectratio and avoid image distortions.
    • 2 -> image will be resized preserving its original aspectratio. differences to the new outputsize will be filled with white
  • width: the destination width. If resize is false, this property only add/change the WIDTH attribute of the IMG tag
  • height: the destination height. If resize is false, this property only add/change the HEIGHT attribute of the IMG tag
  • class: add or change the CLASS attribute of the IMG tag
  • id: add or change the ID attribute of the IMG tag
  • prefix: add a prefix to the resulting IMG tag
  • suffix: append a suffix to the resulting IMG tag

The resulting effect is cool! You can resize the post dimension as you want! Here is a screenshot!
PS: Wowww, WordPress staff has just approved my first plugin!!! I’m very very happy. You can find "Image Extractor" on the official WordPress plugin repository.resulting-effect-image-extractor

0
0

0
0
0

155 thoughts on “Image Extractor

  1. Is there any code to extract the videos from post which i have embed through “Viper’s Video Quicktags” plugin

  2. Hello,

    Today I enabled WP_DEBUG on my wp-config.php file and I’m getting thousands of Uninitialized string offset errors in htmlParser.php.
    Actually it’s a loop of these 3 errors below:
    PHP Notice: Uninitialized string offset: 171 in /var/www/html/wp-content/plugins/imageExtractor/htmlParser.php on line 115
    PHP Notice: Uninitialized string offset: 171 in /var/www/html/wp-content/plugins/imageExtractor/htmlParser.php on line 126
    PHP Notice: Uninitialized string offset: 171 in /var/www/html/wp-content/plugins/imageExtractor/htmlParser.php on line 138

    What those lines have in common is $line[$charsindex] but I’m a complete PHP n00b so I don’t know what to do to fix this.

    Any ideas?

    Thanks!

    • That are “notices” and they aren’t “errors”. The messages mean that a variable wasn’t initialized ($variable = “” ), but the script could run anyway.

  3. Sir, can you please explain how to change the output files to jpg?
    I use this code on my home page (as part of Visual Recent Posts) and the png thumbnails are too large. Thanks!

    • Open the imageExtractor.php file (you find in the wp-content/plugins/imageExtractor/) and edit the line 116.
      Change the following code:
      $thumbnail->save(getenv(“DOCUMENT_ROOT”).$dest,”png24″);
      with:
      $thumbnail->save(getenv(“DOCUMENT_ROOT”).$dest,”jpg”);
      where the change is the text “jpg” instead of “png24″.

      Hope this could help you.

  4. For those who have this problem:

    Fatal error: Image: Imagetype (jpg) not supported for reading

    This is due to a php version >5.3.
    Fix this error by patching the class.ImageToolbox.php. Replate the line 203:
    if ($gd_info['JPG Support']) {
    with this:
    if ($gd_info['JPG Support'] or $gd_info['JPEG Support']) {

    Hope this could help u…
    Cheers

  5. Pingback: Mahesh Ruparel
  6. Hello Mike,
    thanks for this great plugin! I have a question:
    Is it possible to positioning the image at the top and not to the center, if the image is filled with whitespace because of correct aspect ration? Thanks.

  7. Hello. This may be an odd question but a situation has arisen that has made it such that I must extract/resize the first image in a post then display X number of other images as normal. My first image is being resized no problem but none of the other images show up. Can I override this by chance? Any way of showing the other images untouched?

  8. Ciao Mick, avrei da farti un domandone: è possibile integrare il plugin “NextGen Gallery” con image extractor? Le immagini che vengono caricate su nextgen hanno una cartella di destinazione finale differente (/wp-content/gallery/) rispetto a quella dell’extractor (/mat/thumb/). E’ possibile dargli in pasto anche la cartella gallery?

    • Certo che si può, basta metter mano ad una variabile all’interno del plugin di Image Extractor. Però non conosco così bene NextGen Gallery per poter dirti che vengono caricate anche nella galleria. Ciao!

  9. To lo, ale and anybody else who’s getting the:
    html = “”; $this->html=$htmlcode; return true; } function LoadHTML($filename)
    error.

    Try to edit the htmlParser.php file inside imageExtractor dir and check 1st line: if it’s
    <?
    change it to:
    <?php

    This worked for me in my WAMP environment.

    • Thanks. I was getting the code mess at the top of my pages too.
      Running php5.3 and WordPress 3.2

      The problem is that htmlParser.php is not using the current standard <?php opening for php code and the browser is showing the code as html.

      Mick – you should fix this in your source code and issue an update.

      Also, where is the recommend location for the thumb directory? Same as the http document root for our site?

  10. Buongiorno, a me viene fuori questo errore

    Warning: imagejpeg() [function.imagejpeg]: Unable to open ‘/www/www/mat/thumb/72×73-foto021-150×150.jpg’ for writing in /www/www/ivan/ivan-wordpress/wp-content/plugins/imageExtractor/class.ImageToolbox.php on line 679

    non sono molto esperto non so che fare

  11. Hi,
    Image extractor is a great plugin but it doesnt currently work for my site.

    What happens is that for my blog template, on each of my posts, i have a bunch custom fields, one of them is called “img” where i put the url of the image i want to be displayed in my post. However Image Extractor doesnt take images in the custom fields in consideration, because they are not actually in the of the post’s wysiwyg “content”.

    The workaround for this is for me to post the image once in the wysiwyg, with a css class that hides the image, and then put the img url again in the “img” custom field that i use for my blog post templates. This is rather annoying and defeat the purpose of this plugin.

    So my question is this, is there a way for Image Extractor to be aware of the images in the post that are inserted with the custom fields ???

  12. Il fix suggerito per evitare il problema di cropping funziona:

    [code]
    $thumbnail->setResizeMethod('workaround');
    [/code]

    change it to this:

    [code]
    $thumbnail->setResizeMethod('resize');
    [/code]

    Grazie, ottimo plugin, gira bene sulla 2.8

  13. sto avendo dei problemi a far girare il plugin su un server windows.
    quando lo attivo mi appare un sacco di codice, faccio fatica a capire qual’è l’errore.
    help!

    il codice che mi appare è questo: html = “”; $this->html=$htmlcode; return true; } function LoadHTML($filename) { $this->html = “”; if (!file_exists ($filename)) { //return false; } //$filename=”http://www.dynamick.it”; //echo $filename.””; $fh = @fopen (trim($filename), “r”); if ($fh!=false) { //flock($fh,2); while (!feof ($fh)) { $buffer = fgets($fh, 10240); if ($buffer!=””) { $this->html.=trim($buffer); } } //flock($fh,3); fclose($fh); return true; } else return false; } function GetElements(&$result) { if (count($this->elements)==0) { return false; $result=array(); } $result=$this->elements; return true; } function Parse() { $ignorechar = false; $intag = false; $tagdepth = 0; $line=””; $text=””; $tag=””; if ($this->html==””) { return false;} $raw = split (“\r\n”, $this->html); while (list($key, $line) = each ($raw)) { $htmlline = htmlentities($line); if ($line==””) { continue; } $line = trim($line); for ($charsindex=0;$charsindex<=strlen($line);$charsindex++) { if ($ignorechar==true) { $ignorechar=false;} if (($line[$charsindex]=="elements[]=$text; $text=””; } $intag = true; } else if (($line[$charsindex]==”>”) && ($intag)) { $tag .=”>”; /* Tag Found */ $this->elements[]=$tag; $ignorechar = true; $intag=false; $tag=””; } if ((!$ignorechar) && (!$intag)) { $text .= $line[$charsindex]; } else if ((!$ignorechar) && ($intag)) { $tag .= $line[$charsindex]; } } } return true; } function download($file_source, $file_target) { $rh = @fopen($file_source, ‘rb’); $wh = fopen($file_target, ‘wb’); if ($rh===false || $wh===false) { return true; } while (!feof($rh)) { if (fwrite($wh, fread($rh, 1024)) === FALSE) { echo ‘Download error: Cannot write to file (‘.$file_target.’)'; return true; } } fclose($rh); fclose($wh); return false; } function getAttributes($html) { //preg_match_all(‘/(\w+\s*=\s*”[^"]*”)*|(\w+\s*=\s*\’[^\']*\’)*/’,$html,$attr); $attrWithDblQuote='((\w+)\s*=\s*”([^"]*)”)*'; $attrWithQuote='((\w+)\s*=\s*\'([^\']*)\’)*'; $attrWithoutQuote='((\w+)\s*=(\w))*'; preg_match_all(‘/’.$attrWithDblQuote.’|’.$attrWithQuote.’|’.$attrWithoutQuote.’/’,$html,$attr); //echo “#

    “;print_r($attr);echo ”

    “; if (is_array($attr)) foreach ($attr as $count=>$attrArr) { if (is_array($attrArr)) foreach ($attrArr as $i=>$a) { if ($a!=”” and $count==2) $res[$a]=$attr[3][$i]; if ($a!=”” and $count==5) $res[$a]=$attr[6][$i]; if ($a!=”” and $count==8) $res[$a]=$attr[9][$i]; } } return $res; } function linkAnalyzer($url) { $regexp = “(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?”; $regexp = “(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?”; eregi($regexp,$url,$ret); $r["url"]=$url; $r["scheme"]=$ret[2]; $r["authority"]=$ret[4]; $r["path"]=$ret[5]; $r["query"]=$ret[7]; $r["fragment"]=$ret[9]; return $r; } function getTagResource($tag=”a”) { global $elements; $tag=”elements)){ if (strtolower(substr($code,0,strlen($tag)))==$tag) { $attribArr[]=$this->getAttributes($code); } } return $attribArr; } function includeImportCss($html,$path=””,$level=1) { global $urlToGrabArr; preg_match_all(‘/@import\s[\"]*((http:\/\/[^\/]*){0,1}(.*?))[\"]{0,1};/i’, $html,$result); //echo ”
    #”.dirname($path).”#

    “;print_r($result);echo ”

    “;die; if (is_array($result[3])) foreach ($result[3] as $k=>$v) { $url=dirname($path).”/”.$result[3][$k]; //echo “url ricavato: $url
    “; if ($this->url_exists($url)) { $css=@file_get_contents($url); //die ($css); $html=preg_replace(‘/@import\s[\"]*((http:\/\/[^\/]*){0,1}(.*?))[\"]{0,1};/i’, $css, $html); //if (strstr($html,”@import”)) $html=importCss($html,dirname($result[3][$k]),$level++); } } return $html; } function url_exists($url) { $handle = @fopen($url, “r”); if ($handle === false) return false; fclose($handle); return true; } } ?>

  14. hi

    i am getting below error once i activate plugin

    Fatal error: Class ‘htmlparser’ not found in D:\training\wamp\www\wordpress\wp-content\plugins\image-extractor\imageExtractor\imageExtractor.php on line 91

    please help me out how to solve this issue

  15. For anyone having the problem of no images showing up, here is a possible solution (works on Mosso.com cloud hosting with WordPress 2.7.1)

    Edit the file: imageExtractor.php
    Find all instances of: getenv(“DOCUMENT_ROOT”)
    and replace with: $_SERVER["PHP_DOCUMENT_ROOT"]

    Apparently on _some hosts_, DOCUMENT_ROOT doesn’t come through as the correct place on the server to put the files, so the plugin fails to create the thumbnails.

    Stef

  16. Hi,

    Is there a way to override img tag attributes “alt” and “title” with the title of the post which the image is extracted from?

    cheers,
    valix

  17. thnx for the plugin but how to make it to resize all images that I post from other sites not uploaded to wordpress… Can I resize that kind of images or not.. Please answer soon because I need it very much

  18. ciao, mi scuso per l’intrusione ma ho bisogno di aiuto e sono davvero in difficoltà.
    Mi spiego: fino a pochi giorni fa usavo la plugin “alakhnors-post-thumb” ma non so bene per quale motivo ha fatto esplodere il blog, ed è il caso di usare questo termine, visto che ha buttato giù il server aruba per 3 giorni :-(
    Però tante mi piacerebbe avere nella sidebar sx le iconcine delle foro degli ultimi 10 post con i relativi titoli lincati.
    Cosa posso fare?
    Non posso permettermi di buttare di nuovo giù il server aruba, hanno minacciato di sospendere il contratto!
    Questa plugin fa al caso mio ed è compatibile con WP 2.7.x?
    grazie con tutto il cuore per tutto l’aiuto che riuscirai a darmi

  19. Thanks a lot for the plugin. It modified my blog nicely.
    However, you need to modify details of your plugin on wordpress site as it has the wrong syntax. imageextractor rather then image_extractor.

    Cheers,

    pluzz

  20. I had a similar problem where resized images weren’t working, the thumbnail wasn’t being created in the cache file, when I moved hosting. I finally tracked down the problem to the plugin using DOCUMENT_ROOT which was giving the wrong result, I changed it to use PHP_DOCUMENT_ROOT and it all works fine again. Hope this info may help someone else having problems.

  21. I had the same problem as Lindsey and a few others here when using the wonderful Image Extractor plugin on a WordPress site in a subfolder.

    Solution:
    When entering your path in the imageExtractor.php, make sure you add the subfolder path in the beginning. For example for a site: http://www.mysite.com/subfolder and thumb-folder with correct permissions at wp-content/thumb it is:

    $destinationDir=”/subfolder/wp-content/thumb

    Works perfectly.

  22. Question:

    I’m using the plugin on a testing subdomain and when I set the first attribute to “true” none of my images will show. But when I change to false, all the images immediately show, although since I have them set to resize they are becoming a bit distorted.

    I do indeed have the gd2 graphics plugin for PHP. I double checked with my host this evening.

    Funny thing is, I’m using same plugin on the root domain of another site (hosted on same host) and it works fine when set to “true”.

    Any suggestions?

  23. Ciao, ho lo stesso problema di Io, c’è qualche soluzione a riguardo? Mi serverebbe veramente molto questo plugin….
    Grazie per l’aiuto …

  24. Hi,

    I would love to use this plugin but when I try to activate it (wordpress 2.5) it generates an error:

    html = “”; $this->html=$htmlcode; return true; } function LoadHTML($filename) ……………..

    any ideas what may be wrong? I have looked everywhere for a solution but havent found an answer… your help would be much appreciated

    Thanks
    I

  25. hello

    I’m having some trouble setting the cache folder

    $destinationDir=”wpcontent/uploads/”;

    what should i have here?

    thanks

  26. yea, i figured it out.

    @ Jonas Smith: maybe a solution for you too! ;)

    If the pictures are not saved in the original wp-content/upload/ [...] folder, image-extractor
    doesn´t work. so, if your image-link in the post is something like “http://www.example.com/image.jpg”, image-extractor although work with “false”, but the crop function is disabled.

    So, make sure, that your images always are linked to your upload folder! ;)

  27. funny. i´ve got the same problem as Jonas Smith.

    Inserting the first image without resize works fine, the second image – if i have the resize option (TRUE) turned on – wont be shown. It will be empty.

    WP 2.6. Any ideas?

    thx

  28. i got image extractor to work without having a local location on my server, or using uploaded images. all my images are remotely hosted on photo bucket or imagshack, so basically have a “featured” sidebar with loads of images, clickable to the post itself (usually could only done by using uploaded images and plugins).

    my question is, if you can incorporate this with the “relatest posts with thumbnails” plugin, it would be the best plugin ever. having related articles with thumbnails, WIHOUT having the thumbnails’s source coming from physical uploaded images. but from remote hosted images instead… if i can use “related posts to thumbnails” to call “extract_images()” as the output, it would be great, please show me how.

  29. Hi this is an awsome plugin and i have managed to get it working on my site fine for images that are put up manually into each post. But i was wandering if anyone knew if there was a way of manipulating this plugin so that i can extract images from posts that use a “random Image” plugin, or if there is another plugin out there that does this. If so it would be a great help.

    Cheers
    Bobby

  30. First: Excellent plugin, thanks a lot.

    One one site (WP 2.5.0) it works nicely – but in another site (http://jonassmith.dk/weblog/, WP 2.5.1) thumbs don’t get generated. Inserting the first image without resize works fine, though.

    Anyone know what might be the problem? Can it be related to the lates WP version?

    (Thumb folder is fully writable).

    Thanks!

    – Jonas

  31. Ciao, bellissimo plugin ma anche a me non funziona in modalità $resize=true

    Credo che come gli altri amici qui sopra non sia ben chiaro se la path della cache nella configurazione debba essere assoluta a partire dalla root o relativa al template…

    Potresti dirci la path corretta da configurare.

    per il resto è quello che cercavo e per farti felice ti dirò di più: il tuo plugin è risolutivo per il template “Revolution”…

    Grazie ancora…

    Guido

  32. I found a fix for the black areas that many of us were getting when imageExtractor improerly cropped an image. Open up ‘imageExtractor.php’. go to line 112. it should look like this:

    [code]
    $thumbnail->setResizeMethod('workaround');
    [/code]

    change it to this:

    [code]
    $thumbnail->setResizeMethod('resize');
    [/code]

    Thats it.. fixed it for me!

    Thakns for this great plugin!

  33. Ciao, compliementi per il plugin. Io ho un problema, non riesco a capire perchè quando lo inserisco mi rovina tutta la disposizione del sito.

    Posso collegare il plugin al codice che elenca i post recenti o quelli più letti?

    Grazie Mille

    Andrea

  34. Will the “Image Extractor” plug-in be updated to address the issues with incorrect cropping (using resize type 1) and image quality? Sometimes I notice the new images are of great quality.

    Looking forward to the future release!

  35. I want to activate this plugin on localhost (wampserver), but I can not, because it gives error. How to install it?

  36. ciao, il tuo plugin sarebbe per me una mano santa…se solo riuscissi a farlo funzionare! :)

    questa è la funzione che scrivo:
    image_extractor(true, 1, 240, 180, ‘post-image’,”, ”, ”);

    ho WP 2.3.2, la cartella per le immagini è abilitata alla scrittura, ho il supporto GD sul server.
    Ma con il true non mi funziona, non mi resiza le immagini e non succede nulla. Se metto false invece funziona, ma non è quello che mi serve, perchè mi stretcha le img.

    Questo è ciò che scrivo nel file di configurazone della dir:
    $destinationDir=”/_img/thumbs/”;

    Quale potrebbe essere il problema?
    Grazie in anticipo per il supporto, ciao

  37. I’m using Resize Type 1 and it’s not working correctly, as described by others. It crops the images incorrectly, leaving big black spaces.

  38. Is it possible to use this plugin to show the image from the previous or next posts? I want to do a previous and next post preview thumbnail on single view pages…

    ®

  39. Hi there,

    GREAT plugin! I use it on my own site no problems, but I’m doing a new site for someone else now and I’m getting the same error as abelafonte when I set resize to true:

    Fatal error: Image: Outputwidth and -height must be integers greater zero.

    …but I have them both set to 100

    Also, where do I create the image cache folder? Where is the location /mat/thumb/ relative to?

    ®

  40. hi mick,
    I’m currently using wp 2.3.2, when i enable this plugin in my sidebar this error comes out.
    [quote]require_once(dddd.com/wp-content/themes/default/sidebar.php) [function.require-once]: failed to open stream: No such file or directory at dddd.com/wp-includes/theme.php (440)
    timed at 14-Jan-2008 13:26:28

    [/quote]
    any idea guys

  41. Ciao Mick,

    C’è un modo per fare si che l’immagine sia un link al post?

    Io ho provato così:

    ', ''); ?>

    Ma la funzione “the_permalink” non funziona (scusa il gioco di parole).

    Hai qualche suggerimento?

    Ciao e grazie.
    Giovanni

  42. x Mick
    I tryed to install Image Extractor, but I failed… =( few strange errors appeared & I just deactivate it. Today I surf your blog & understand all usefulness and power of your plug-in. As soon as I’ll write a tutorial for you about creating headers like mine, I’ll try to install plug-in one more time… because I really need its functionality for dezignus.com, & for my future projects!
    (ps. Sorry for my English, I’am Russian)

  43. X Meerblickzimmer: perhaps the image is too big, and the php exceed the allowed memory.
    X Stanly: My plugin works exactly as you describled. Try it!!!

  44. Hello Mick.
    I’am trying to find plugin or function, to extract an image from post, resize it, & put above the title of post in “Recent Posts” field (in the slidebar).
    Is it possible to do with your script?

  45. Hei! Thanks for your great plugin but i have a problem. It doesn´t resize the image but the GD Support er enabled and the folder has 777. Do you have any idea?

    Greatings!
    Meerblickzimmer

  46. could you tell me how to establish a permalink to PNG image?

    I tried the following syntax, but I couldn’t it.

    <?php
    $posts = get_posts('numberposts=1&category=6');
    foreach($posts as $post) :
    setup_postdata($post);
    image_extractor(true, 1, 200, 0,'img_L','','<a href="<?php the_permalink() ?>">','</a>');
    ?>

    Thanks for this plugin.

  47. could you tell me how to establish a permalink to PNG image?

    I tried the following syntax, but I couldn’t it.
    “>’,”);
    ?>

    Thanks for this plugin.

  48. Problems installing. I am setting the php file to the correct writable folder and am attempting to install. Getting all sorts of errors once i click the “activate” button. Then i have to deactivate immediately or i have an issue with my header in the wp-admin? Anyone else run into this issue?

  49. Like Robert McPeak asked, I also have a need for this sort of plugin. One reads WordPress feeds, pulls the first image out of said feed and displays the image, post title and a link from the post title to the actual post. I probably could mash one up, but if someone already invented this wheel, I’d be interested. Thanks!

  50. I’ve modified you plug in get a parameter that tell him to “echo” or “return” the results.
    this is useful if you wanna use the URL returned in some other php function or variable.
    maybe in the next version u can incorporate that.

  51. Mi spiego meglio, inserendo il tag nel loop del file home.php ( che è poi la pagina iniziale del sito ) compare solo l’header, tutto il resto della pagina è bianca, quindi suppongo che il loop venga bloccato dal tag image_extractor..

  52. Ciao, complimenti per il plug-in !! volevo segnalarti che ho inserito questo codice nell’index.php , dopo aver installato il plug-in, purtroppo però non accade nulla, le GD funzionano correttamente, puoi darmi qualche consiglio ?
    Grazie mille

  53. Hi Rafael or Mick!
    I have the same problem with the cropping method 1. That’s the one I would like to use. But I get these ugly black borders, and the actual image is hardly visible (too narrow). Please send me your updated plugin, I really would like to use it here: http://bentographics.com/site/
    It would be great to have an option, where the plugin should crop, i.e. center of the image, otherwise one ends up with a lot of borders and not much of the actual image or graphic you want to display as thumbnail.
    Please write me, my email is on my website or use bentoenterprises {at} gmail {dot} com. Thank you lots! b

  54. I am not good at php, but I founded and fixed 2 erros I was getting:
    1- The generated code was showing a number one just before src, like this: <img 1 src=”file.png” width=”50″ alt=”” />
    I added a str_replace to take that one out.
    2- The resize method 1 was generating weird images with lots of black spaces (even with the background color was white) and with just a few pixels of the original image. I really do not know the reason for this, but I solved changing the save extension from png24 to jpg.
    It is all working good now, but maybe you can find out the reason why it was acting like that. If it helps, my websites are hosted at BlueHost and the line code was identical to yours in How to Use session. Those were the only code changes I made.

  55. Thanks Luke, I’ve updated the Image Extractor project with your tips and I hope many problems could be resolved.
    For those who catch some problems, I suggest to download the new version.

  56. Hi, when the post don’t have an image, the function image_extractor(…) outputs an img tag like this: and will display an empty image on browser. You need to check if you have an image on the post… Best regards, Cip.

  57. I was also getting this error:
    Warning: Cannot modify header information – headers already sent by (output

    For line 692 of class.ImageToolbox.php so I simply commented it out and everything seems to work fine.

  58. You have a bug if you have a post with no images… it still tries to resize.
    I added this at line 100 of image extractor.php and it seems to have fixed it:
    if ($attribArr==false) return;

  59. Hello

    This is a fantastic plugin, I am using it here:
    http://www.holster.co.uk/wordpress/archives/24

    The only problem is that I am still getting the image shown as part of the original post. How can I only show the text of the post, or is there an equivalent ‘text-extractor’ plugin?

    Basically I would like to be able to show the text and the image of a post independently, and your plugin has helped me get half way there….

  60. giusto, hai ragione. Alla riga 4 c’è il title, che ho commentato con , questa sera provo a toglierla, strana cosa. Scusa la poca dimestichezza, ma la linea 692 non c’è, puoi indicarmi cosa dovrei controllare? Grazie per il supporot :-)

  61. Ciao Franco,
    sinceramente non saprei darti un aiuto. Dovresti dirmi cosa c’è alla riga 4 di header.php e la riga di codice dove invochi imageExtractor.
    Ciao,
    mick

  62. Ciao Mick, e complimenti per il plugin. Ho qualche problema nell’installazione: se wordpress è installato nella root, e la cartella cache (777) è /images/thumb qual è il percorso corretto nel file php? /images/thumb/ , giusto?

  63. For Yas V: Image Extractor works only for local images.
    For Jason: I’ve tested Image Extractor on WordPress 2.1.3 and it works fine. I suppose your problem is related to bad image formats. Check if your images are a standard jpg, gif or png.

  64. I keep getting this error any help would be great.

    Warning: getimagesize() [function.getimagesize]: Read error! in /home/spllogic/public_html/ctk/wp-content/plugins/imageextractor/imageExtractor.php on line 104

  65. This plugin is awesome does what I needed. Although I notice when images are posted from an external site such as image shack the image isn’t extracted. Is it something I’m doing wrong ?

  66. Hi Rafael,
    I suppose your problem is due to the missing of the gd2 graphic library extension from the php ini file of your hosting server. You can check it by creating a file with this line inside: < ? phpinfo(); ?> and verify the GD2 is loaded in the php extensions.
    I hope this can help you.
    Mick

  67. Problems… I installed the plugin at my website, but everytime I set ‘true’ to ‘resize’, no image is loaded. If I set to ‘false’, it works fine. I changed the folder variable to the same folder I upload my images with wordpress, but it still does not work.
    I am pretty sure the problem is with the hosting company, but I do not know exactly WHAT should I ask them to change. Any clue?

  68. For Opocaj: um…I suppose this new problem could be related to the image size. If the image is too big, the resizing may fail. Resolve this problem manually: delete the broken image from the cache folder (/opobl/thumb/thumb395x100-CHRYSLERsmall.png), and regenerate it by refreshing the page.

  69. Tank you very much for your patience,now it’s work!
    Just one more thing:
    I’ve tried it with some different size’s images
    using resize_type “1”.
    mostly it’s works fine but sometimes(maybe with big images) it starts to crop from the bottom or puts a black portion ,as you can see here: http://www.opocaj.it/opobl/
    Maybe i’m wrong, but It could be better if it starts cropping from the center of the image.
    I hope this last post will be usefull also for you,
    tanks,
    j.

  70. eheh… you’ve to add the php tag (< ? and ?>) before and after any php statements. So, the result is:
    < ? echo image_extractor(..); ?>
    where the “…” are the function parameters. Hope this can definitely resolve your problem.

  71. Ok Opocaj,
    you have to write “echo image_extractor(..);”. If it not works, check you’ve php_gd2.so enabled in your php.ini.

  72. sorry,I’m sure your plugin works fine,maybe the problem is my knoledge of php.
    this is what i’ve done:
    1-in imageExtractor.php i’ve only changed the line with the ‘destination dir’ nothing else.

    2-I’ve put your code in this way:

    image_extractor(true, 1, 395, 0, ‘’, ‘’, ‘’, ‘’);

    ….

    but ,when i look at the blog it doesn’t work and appear :
    image_extractor(true, 1, 395, 0, ‘’, ‘’, ‘’, ‘’);
    before the post.

    what’s wrong?
    thanks
    j.

  73. sorry ,but i’m new to php,i’ve tried to put the code inside the loop but always get sintaz error .Can u please write me how exatly the code would be?
    this is my index.php:

    “>

    Filed by on under || “>

    thanks so much,
    j.

  74. Hi Opocaj,
    the “image extractor” plugin works inside “The Loop” of WordPress. Bring your template/index.php and inside the “while” loop that cycles between the posts, you can use the image_extractor plugin. Hope this can help you,
    cheers,
    Mick

  75. Ciao Mick,non riesco proprio a far funzionare il tuo plugin.in “How to use” hai riportato una parte di codice:Bisogna inserirla manualmente nel Main Index.php?o magari nel single post?
    grazie j.

  76. Great Plugin. I got everything working, but after the thumb is created, it’s permissions are 644, so it doesn’t get displayed. Once I manually change the permissions, it shows perfectly — how can I solve this? (the thumb directly is set to 777)

  77. Hi Gabu,
    you’re right. I’ve forgot to notice that the plugin needs the GD extension.
    You’ve to enable the php_gd2.so (or php_gd2.dll) inside your php.ini.

  78. Hello!
    I’ve instaled your plugin and uploaded a ‘.jpg’ image to test it. I got the following message while the image wont show: “Fatal error: Image: Imagetype (jpg) not supported for reading. in d:\arquivos de programas\easyphp1-8\www\wp-content\plugins\imageExtractor\class.ImageToolbox.php on line 461″
    Do you have a hint of the problem?

    Thank you very much!

  79. Hi again, I downloaded the new version, activated it, and I got the error “headers already sent” in class.ImageToolbox.php. I noted that the closing “?>” tag at the end of the code was missing, I added it, and everything goes fine! :)
    Thanks a lot!

  80. Hello.
    I didn’t get exactly where to ad the code. I’m using the cutline theme, and here is code. Can you show me where to insert the code ? Thanks !!

  81. To Sergio: Thanks for your bug hunting. The problem is now resolved thanks to you.

    To Matthieu: Woww… thanks a lot for your review in the WordPress France blog.

  82. Hi Mick, I’m using WordPress 2.1.2, and when I activated and used the plugin, I got the following error message in my site:

    Fatal error: Call to undefined function: get_the_excerpt_reloaded() in /public_html/wp-content/plugins/imageExtractor/imageExtractor.php on line 64

    What should I do?
    Thanks a lot,
    Sergio

  83. To Srijit: You can specify % if the resize option is turned off. In case you have enable the resize=true you have to specify the exact pixels width or height or both.

  84. To Matthieu (2): I’m sorry, but I don’t know WPMU. If you are able to adapt Image Extrator to WPMU, tell me how, and I’ll modify it in the SVN repo.

  85. To Matthieu: in your template folder, open index.php. Walking inside the code, you’ll find the while that loop through the posts:

    <?php
      while (have_posts()) : the_post();
        ...
      endwhile;
    ?>

    Inside that loop, you can use a lot of predefined template function, such as the_excerpt(), the_post(), the_title(), etc… Installing Image Extractor, you’ll able to use a new template function: image_extractor(true, 1, 395, 0, ‘’, ‘’, ‘’, ‘’); It’s very simple and I think the plugin doen’t need more documentation. I hope this is enought. If you have any other doubts, don’t esitate to ask me. Cheers, Mikc

  86. I’ve been waiting for a plugin like for a *long* time. Thanks for sharing.

    What would be tremendous is to push the plugin in WPMU playground. It would be really usefull combined with “display last 10 posts from all platform” plugins.

    I am actually working on a wpmu platform for radio in paris. Check out my “sand box”.

    If you want to play with me with your plugin let me know and we’ll talk about that.

    Thanks again

    matthieu

  87. This looks really cool. When you have time you should put some help documentation for dummies (like me). I couldn’t get this working without errors. I’ll check back later.

  88. per funzionare, funziona. ma non riesco ad adattarlo nel plug-in che serve a me, ovvero random posts. magari lo uso in altro modo, appena mi viene in mente come. ottimo lavoro, in ogni caso!

    /n.

  89. eccezionale! lo cercavo da un sacco di tempo un plug-in di questo tipo. e tu lo hai creato proprio come serviva a me! :)

    questo pomeriggio mi metto subito a provarlo e poi ti faccio sapere cosa ne penso!

    complimenti!!

    /n.

Comments are closed.