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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:48:08+00:00 2026-05-13T09:48:08+00:00

I need to build a PHP photo processing class, I know there are MANY

  • 0

I need to build a PHP photo processing class, I know there are MANY that already exist to the public but I need to build one to do just what I need done and nothing extra and nothing less.

I need my class to do this…

1)
I create a new instance of my class and I pass in either a URL of a photo, or the path to a local photo being uploaded using POST form.

2)
I then need to take the main image and check it’s dimensions, if it is wider the 800 pixels, I need to resize it down, if it is not wider then 800 then I just leave it

3)
We now need to build 2 different sized thumbnails from this image, if we resized the image to meet our 800 pixel requirement then we use that image to make the thumbnails from, otherwise we make our thumbnails from the original image.

4)
We then update a few a database records

Then completed.

I know this is not that difficult but I need to build this with best performance in mind, for example if a user uploads a 2mb photo, I don’t want to hog up memory and keep building thumbnails from that photo if we already madea smaller image I think it should then use the smaller image to build out thumbnails from.

With all this information now, do you have any suggestions on how to do this in GD or imagemagick. If I make a method that does the thumbnails, how should I make sure it keeps using the smaller images to make other smaller images? I have looked at some existing image classes and they all are very complex and over done IMO however none do exactly this simple task.

  • 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-13T09:48:09+00:00Added an answer on May 13, 2026 at 9:48 am

    The PHP GD library uses a resource object to represent images. You can use imagecopyresampled or imagecopyresized to resize the image.

    If it has been resized, use the new resized image object for future operations, otherwise use the original resource object.

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

Sidebar

Ask A Question

Stats

  • Questions 303k
  • Answers 303k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Whenever I see an XML document like this, my first… May 13, 2026 at 8:38 pm
  • Editorial Team
    Editorial Team added an answer signed (int / short etc, rather that uint / ushort)… May 13, 2026 at 8:38 pm
  • Editorial Team
    Editorial Team added an answer This is one possible solution although not very clean: Make… May 13, 2026 at 8:38 pm

Related Questions

I've been trying to build a simple prototype application in Django, and am reaching
We are a small team of developers planing to develop a php application. (let's
Part 1 I want to build a PHP Zend Framework application that users can
I'm trying to build a simple Magento Module that needs to connect to the
I need to build a little webapp but I'm not sure what is the

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.