/    Sign up×
Community /Pin to ProfileBookmark

Image Manipulation – Height, Width, DPI

Hey All,

I have been looking for a PHP solution for my problem.

I have seem many sites that show you how to re-size the Height and Width of an image, but nothing with the DPI of an image.

Problem;

Have an image of 800 x 600 with a DPI of 200

Solution:

Need to re-size the image to a smaller number divisible by 8

AND

to have the image at 120 DPI

Setup:

Running php 4.3
OS: Suse 10.1

Do not have the GD library installed :-(, but I think I can install it if needed

Thanks in advance

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@kbc1Aug 07.2007 — Hi Phil

Images can only be viewed at 72 DPI on a web page anyway so what is the need to resample at anything above?

The GD library (which you will need to install) comes with a couple of functions that will help you out:

[code=php]imagecopyresampled();
imagecreatetruecolor();[/code]


Good luck
Copy linkTweet thisAlerts:
@Phill_PaffordauthorAug 07.2007 — The reason is that these images goto a mainframe and need to be in a certain format
Copy linkTweet thisAlerts:
@ellisglAug 07.2007 — I would also look at imagemagick.
×

Success!

Help @Phill_Pafford spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.22,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...