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 7661367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:35:20+00:00 2026-05-31T13:35:20+00:00

On Codeigniter , I’m using phpThumb to generate images. I didn’t use the built-in

  • 0

On Codeigniter, I’m using phpThumb to generate images. I didn’t use the built-in CI image library because it couldn’t do the “zoom-crop” feature of phpThumb, which I badly need (ability to create thumbnails of the same size regardless of their original size/proportions, by zooming and cropping when necessary).

Everything is working fine except my images’ src look so ugly:

<img src="lib/phpThumb.php?src=../../upload/photo/file.jpg&w=100&h=100&zc=1" />

I was hoping to make it look something like this instead:

<img src="photo/display/file.jpg" />

by wrapping phpThumb in a CI controller photo with the method display($filename) {}

I was able to do this using the built-in CI image library, but I’m at a loss on how to use phpThumb instead.

Any suggestions?

  • 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-31T13:35:21+00:00Added an answer on May 31, 2026 at 1:35 pm

    I found a different PHP thumbnailing library (also called PHPThumb) and used it: https://github.com/masterexploder/PHPThumb/wiki

    Here’s my CodeIgniter class:

    class Photo extends CI_Controller {
    
        function __construct() {
            parent::__construct();
        }
    
        function display($filename) {
            require_once('./lib/PHPThumb/ThumbLib.inc.php');
            $thumb = PhpThumbFactory::create('./upload/photo/' . $filename);
            $thumb->adaptiveResize(100, 100);
            $thumb->show();
        }
    
    }
    

    Now my img looks better:

    <img src="photo/display/file.jpg" />

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

Sidebar

Related Questions

Using CodeIgniter, I am trying to place several images onto my view page as
I am using CodeIgniter 2.1.0 and MySQL database. I have uploaded an image through
Using codeigniter image lib is it possible to just change an image type? Trying
I currently use CodeIgniter as my framework of choice when using PHP. One of
CodeIgniter is brilliant but I'm using it to develop a site where users need
In CodeIgniter I'm using a base CRUD My_model , but I have this small
in codeigniter you can use wildcard to reroute. i never heard the word wildcards
Codeigniter has its own Models path, where models extend from CI_Model. I'm using RedBean
Using Codeigniter, any numeric data returned from my MySQL database is returned as strings.
Using CodeIgniter, how do I access and display text entered into an input field

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.