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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:50:59+00:00 2026-06-04T13:50:59+00:00

I have an image resource that is manipulated with imagecopyresampled . I need to

  • 0

I have an image resource that is manipulated with imagecopyresampled. I need to pass that image to a set of methods that expect a string input, not a resource. But I don’t need to store the file locally.

Is this the proper way:

  1. Store the image with imagepng and imagejpeg
  2. Pass string (filename) to the methods
  3. Destroy the stored file with @unlink

Is that right? Seems sloppy.

Note: the image is not coming from a file upload and hence can’t be accessed with $_FILES["Filedata"]["tmp_name"]

  • 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-06-04T13:51:00+00:00Added an answer on June 4, 2026 at 1:51 pm

    I took a look at the Amazon S3 PHP API:
    http://docs.amazonwebservices.com/AWSSDKforPHP/latest/index.html#m=AmazonS3/upload_part

    I assume you are using something like the upload_part method that takes a string filename. In that case, unless you plan to modify their library, you will need to store the file to disk and pass them the filename so they can read the file and perform the upload.

    Besides the steps mentioned in your question you can take a look at imagedestroy to make sure you are freeing up the memory for your image resource after it is written to disk with imagepng. And then, as you stated, you can delete your temp file with unlink after your upload is complete.

    I agree, it does seem a bit wasteful, but in this case necessary since the API doesn’t seem to provide an alternative.

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

Sidebar

Related Questions

I have an ImageView that has a drawable image resource set to a selector.
I have an image that I have in my bundle resources that I need
I have image map that can I move, but this map will be so
I have an image (embedded resource) that i can get access to and form
I have a class that accepts a GD image resource as one of its
I have an issue where an image resource (Default.png) is included in a build
I have added an image to my form's resource file, myForm.resx, and I would
I have image Array with two images out of that first image its showing
I have a jpg image in my resource folder. Now i want it to
I have a C# Web app that runs perfectly fine in VS2010, but when

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.