Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 804829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T23:58:57+00:00 2026-05-14T23:58:57+00:00

i wan’t to know how to generate thumbnails with phpThumb Class, with an array

  • 0

i wan’t to know how to generate thumbnails with phpThumb Class, with an array with file paths already. And then Save the result of each image on other path but with the same name.

Thank you all 😉

EDIT:
I have my code something like this:

    echo "A iniciar gerador de miniaturas para a área de cliente: \n";
    include $wincli['files']['phpThumbClass'];
    $files = file_list($wincli['dirs']['logos']);

    $phpThumb = new phpThumb();
    foreach( $files as $file ) {
        echo "  # A converter o ficheiro '".basename($file)."' : ";
        if(is_file($file)){         
            $phpThumb->setSourceFilename($file); 
            $phpThumb->setParameter('w', 880);
            $phpThumb->setParameter('h', 241);
            $phpThumb->setParameter('q', 90);
            $phpThumb->setParameter('zc', 1);
            $outputFilename = $wincli['dirs']['logosthumbs'].$file;

            if($phpThumb->GenerateThumbnail()){
                if($phpThumb->RenderToFile($outputFilename)){
                    echo "OK \n";
                }else{
                    echo "Falhou (Ao guardar no ficheiro)\n";
                }
            }else{
                echo "Falhou (Ao gerar miniatura)\n";
            }
        }else{
            echo "Falhou (Ficheiro inexistente)\n";
        }
    }

This is the Debug:

phpThumb() v1.7.7-200612252156 in file "phpthumb.class.php" on line 216
setSourceFilename(/var/www/virtual/test.com/wincli/logos/001-0.jpg) set $this->sourceFilename to "/var/www/virtual/test.com/wincli/logos/001-0.jpg" in file "phpthumb.class.php" on line 234
  file_exists() = 0 in file "phpthumb.class.php" on line 1036
is_executable() = 0 in file "phpthumb.class.php" on line 1037
ImageMagickThumbnailToGD() aborting because cannot find convert in $this->config_imagemagick_path (), and `which convert` returned () in file "phpthumb.class.php" on line 1066
$AvailableImageOutputFormats = array(text;ico;bmp;wbmp;gif;png;jpeg) in file "phpthumb.class.php" on line 825
$this->thumbnailFormat set to $this->config_output_format "jpeg" in file "phpthumb.class.php" on line 835
$this->thumbnailQuality set to "90" in file "phpthumb.class.php" on line 852
!$this->config_allow_src_above_docroot therefore setting "/var/www/virtual/test.com/wincli/logos/001-0.jpg" (outside "/var/www/virtual/test.com/htdocs") to null in file "phpthumb.class.php" on line 1001
$this->sourceFilename set to "" in file "phpthumb.class.php" on line 754
phpThumb() v1.7.7-200612252156

"" does not exist in file "phpthumb.class.php" on line 3404
setCacheDirectory() starting with config_cache_directory = "" in file "phpthumb.class.php" on line 859
$this->config_cache_directory () is not a directory in file "phpthumb.class.php" on line 895
SetCacheFilename() failed because $this->config_cache_directory is empty in file "phpthumb.class.php" on line 2808
starting ExtractEXIFgetImageSize() in file "phpthumb.class.php" on line 2665
GetImageSize("") failed in file "phpthumb.class.php" on line 2688
$this->useRawIMoutput=false because "fltr" is set in file "phpthumb.class.php" on line 1151
ImageMagickThumbnailToGD() aborting because $this->sourceFilename is empty in file "phpthumb.class.php" on line 1196
ImageMagickThumbnailToGD() failed in file "phpthumb.class.php" on line 2695
SetOrientationDependantWidthHeight() starting with ""x"" in file "phpthumb.class.php" on line 2644
SetOrientationDependantWidthHeight() setting w="880", h="241" in file "phpthumb.class.php" on line 2660
EXIF thumbnail extraction: (size=0; type=""; 0x0) in file "phpthumb.class.php" on line 2747
starting SourceImageToGD() in file "phpthumb.class.php" on line 3005
$this->useRawIMoutput=false because "fltr" is set in file "phpthumb.class.php" on line 1151
ImageMagickThumbnailToGD() aborting because $this->sourceFilename is empty in file "phpthumb.class.php" on line 1196
Not using EXIF thumbnail data because $this->exif_thumbnail_data is empty in file "phpthumb.class.php" on line 3046
$this->gdimg_source is still empty in file "phpthumb.class.php" on line 3098
ImageMagickThumbnailToGD() failed in file "phpthumb.class.php" on line 3100
phpThumb() v1.7.7-200612252156

Unknown image type identified by "" () in SourceImageToGD()[3210] in file "phpthumb.class.php" on line 3404
SourceImageToGD() failed in file "phpthumb.class.php" on line 312
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T23:58:58+00:00Added an answer on May 14, 2026 at 11:58 pm
    $files = array('filename.jpg', 'filename2.jpg');
    foreach( $files as $file ) { // here's part 1 of your answer
       $phpThumb->setSourceFilename($file); 
       $phpThumb->setParameter('w', 100);
       $outputFilename = "thumbs/".$file;
    
        if ($phpThumb->GenerateThumbnail()) { 
            if ($phpThumb->RenderToFile($outputFilename)) { // here's part 2 of your answer
               // do something on success
            } else {
               //failed
            }
        } else {
            // failed
        }
    }
    

    See http://phpthumb.sourceforge.net/index.php?source=demo%2FphpThumb.demo.object.php for more info

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wan to monitor changes in android system file /sys/class/net/eth0/operstate for monitoring ethernet state.
I wan't to build SMS triggered app in my android. I know there's a
I wan to convert a string for example 1,2,3,4,5,6 to an array of integers
I wan't to open a pdf file on Xcode using phone gap[corodova 1.7.0]. Is
i wan to ask that if my machine got 1000/10000 of image and each
I wan't to search a filename for example like this string: $filetype = file.php.jpg;
i wan't to know if there is a way to decrease the Run Speed
I wan't to have a function that turns spell check on then go's to
I wan an array which is going to have about 30 things in it.
I wan't to load some data from my XML file using this function: public

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.