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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:54:16+00:00 2026-05-25T00:54:16+00:00

I usually try to find solutions on my own, however for this particular case

  • 0

I usually try to find solutions on my own, however for this particular case I don’t know what to search for to reach my goal.

Alright, so here’s the thing: I’m trying to find a server-side script (preferably in PHP) that crops an image (the background) down to the client’s screen resolution before being downloaded by its browser.

My goal is that the browser shouldn’t have to download parts of the image that won’t fit in its screen.

Ideally, if it could crop using center-top as origin, it would be perfect.

I’m not a big fan of asking for such things, but I don’t know how to code it myself and like I said, I don’t know what to search for.

Thanks a lot if you can help.

  • 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-25T00:54:16+00:00Added an answer on May 25, 2026 at 12:54 am

    You can’t do it in a single step. Browser/window size data is NOT available in standard HTTP requests. It has to be retrieved using some Javascript and sent to the server. This means the user has to load a page from your site before you can know anything about the browser. The script COULD dynamically rewrite all image tags in the page to include the window specs as part of the image url e.g. src="resizer.php?id=logo.jpg&x=1024&y=768".

    However, remember that mere browser size isn’t a good determination of the display environment. The user could resize/maximize their window and now they’ve got empty spaces around the edges of the background because it was resized only to the original window/desktop size. They can zoom the page in/out, which again invalidates the actual pixel sizes, etc…

    Instead of worrying about offscreen image portions, try to simply reduce the filesize of the background to as small as possible by playing with compression levels. Find a compression level that leaves the background at a nice looking image quality, but also as small as possible a filesize.

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

Sidebar

Related Questions

I usually try to do TDD with not much analysis (no diagrams) before start
When I am making methods with return values, I usually try and set things
Usually, I try to set my folders to have permission 775, but some web-hosting
I usually made php forms and try to use good practices in them. I'm
When I try to compile an assembly in VS 2008, I got (occasionally, usually
Usually when I need to fork in C, I do something like this: pid_t
I don't know what I did to my VS2008 or IE9 on my laptop,
I can't find any documentation to confirm this, but it appears that you can
I don't really know much about the internals of compiler and JIT optimizations, but
First time asking a question here. Usually I can find my answer without having

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.