Solved

PHP GD

Posted on 2011-02-21
7
827 Views
Last Modified: 2012-05-11
Hi i want to generate card by php GD library. I generate perfect image for me but it have only 72 dpi. Is any way to generate with 300 dpi image.
0
Comment
Question by:umaxim
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 27

Expert Comment

by:Lukasz Chmielewski
ID: 34947304
0
 
LVL 9

Expert Comment

by:AriMc
ID: 34947325
The DPI in a jpg (I assume that's the format you're using) is just a setting in the headers, but you could try this:

http://www.develobert.info/2008/11/php-jpegjpg-dpi-function.html

0
 
LVL 1

Author Comment

by:umaxim
ID: 34947722
I use png
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 9

Expert Comment

by:AriMc
ID: 34947747
Ok, what is the reason of wanting to have different DPI? Pixels are just pixels regardless of the format they are stored in.

0
 
LVL 110

Expert Comment

by:Ray Paseur
ID: 34951072
Do not worry about the DPI.  Just create the PNG image of the pixel dimensions you want to use.  Typically computer display densities are 72 or 96 DPI.  Print densities are usually 150 to 300 DPI.  If you want to put an image on the screen and also print the image, you need to use two different image files.

You might skip this step if the images are very small - just use CSS to express the display width and height.  But you probably don't want to interject a 3 MB image into a 300x200 picture window.

When it becomes time to print the image, your client can set the pixel density to a level that is suitable for the printer.  

0
 
LVL 1

Author Comment

by:umaxim
ID: 34970389
This is a problem i do not show image to people i just save it to print on server.
0
 
LVL 110

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 34971146
OK, let's look at it this way.  Let's say you want a card that is 3 inches wide, and you want to print it at 300DPI.  Make the image 900 pixels wide.  Set up your printer to print at 300 DPI. Et voila.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question