Re: [PHP] How does one obtain the resolution of an image in PHP?

2006-03-17 Thread Barry

Arnaldo Gandol wrote:

hi, I have troubles with strangers characters in my html pages, I've fixed
them by using mb_convert_encoding() function with  UTF-8  encoding  but I've
hear that mbstring library is unstable in some linux distributions. Does any
body knows how to solve this problem without using mbstring library. I'm
working with php-5.

Thank you beforehand.

Yeah if you tell me what that has to do with the resolution of images!

Please create a new post on the main list!
--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How does one obtain the resolution of an image in PHP?

2006-03-17 Thread John Hinton

- Edwin - wrote:

Hi!

On Thu, 16 Mar 2006 14:31:38 -0500
John Hinton [EMAIL PROTECTED] wrote:

  

Simon M. Campden-Main wrote:


Well, there's the meat of it, isn't it?  I wonder how Paint
Shop Pro comes up with PPI (Image - Image information). 
I have several thousand scanned images with resolution

ranging from 72 PPI up to 1200 PPI (As reported by Paint
Shop Pro) and want to discard, or more likely tag as
rejected, any that suffer a resolution of less than 150
PPI.  As you might imagine, I find the thought of
doing it manually with Paint Shop Pro repugnant.
  


Okay, if it was scanned at 72ppi then you can't really print
it out again even with a near-similar quality. However, having
an image with a 72ppi does NOT necessarily mean that you
have an image unsuitable for printing.

  

PPI or pixels per inch is a printing term.



Last time I checked, dpi is the printing term. (^_^)

  dpi (dots per inch) - printer
  ppi (pixels per inch) - monitor/screen

  
Still missing it.. Yes, dpi is a printing term.. but has absolutely 
nothing to with with images. dpi or Dots per Inch is purely a term 
that describes the limits of your printer. If for instance, we are 
talking about an ink jet printer with a 600 x 600 dpi capability, with 
black and three colors, that printer can print any of the four color or 
not print in a space 1/600th of an inch as it moves along. And there is 
no blending within that one dot... it's simply one of the colors or left 
the white or the paper color.


One might think that an image should be scanned at 600 dpi to provide 
and equal quality, but really you can scan at a much reduced resolution 
and get the same results with a basic inkjet color printer, because the 
scan will most often be done at 16.7 million colors.. the printer only 
has 4(+paper color) so it really takes a 4x4 dot area or so to start to 
get close to matching a single pixel. Now, lets don't even go there on 
printers. The above is greatly understated and was how old inkjets 
worked.. much has changed and I really haven't followed exactly what 
they are doing now, but obviously it seems that there is a blending over 
top of other colors in today's printers. Just trying to provide 
simple theory, quick to type, easy to grasp.


So, yet still ppi is being misrepresented.. Please stop doing this.

If you don't believe me try this. Open a quality paint program. In fact, 
Macromedia's Fireworks in the image sizing dialog  box separates pixel 
dimensions from ppi putting ALL ppi function under the heading of Print 
Size. The example.


Open or create an image 600 pixels x 300 pixels.

Make sure you stay at 100% zoom factor.

Set the printing Pixels/Inch to 150, but don't let the program change 
the Pixel dimensions. You will be given a print size of 4 x 2. The 
image will take up 600 x 300 pixels of your monitor screen space.


Now with that same image, change only the resolution to 300. Leave the 
pixel dimensions the same (one has to be careful with the locking of 
proportions and samplings to be sure the program doesn't change the 
pixel dimensions when changing the Pixel/Inch). You will now see that 
the print size is 2 x 1, but yet the image size on the screen has not 
changed sizes.


A pixel is a pixel to a monitor. A pixel is sent thru an algorithm on 
the way to a printer and by and large, print quality has to be much 
greater than monitor quality to 'look' as good. Basically, you can't get 
a 4 wide image on the screen to look as good when printed at 4 wide.


A general guideline is images for print should be no less than 150 ppi, 
newspaper quality, and 300 to 600 is recommended for color brochures and 
near photo quality. So, using our example above and assuming the 
printing company has requested 300 ppi images, that image at 600 x 300 
which fills a major portion of one's monitor screen, can only be printed 
under this constraint at a maximum of 2 inches x 1 inch. If you're going 
to print, check with the printer before beginning as print quality is 
generally rising at all levels.


The question of throwing away all images with 72dpi is irrelevant.

The questions are:
What resolution, pixels per inch, do you want to print at? Lets assume 300.
What size are the images in pixels? Lets assume 1200 x 900. (I know, odd 
size but easy math to follow)
Are you happy with printing these images at 4 inches x 3 inches? ((1200 
pixels / 300 pixels per inch = 4 inches) x (900 pixels / 300 pixels per 
inch = 3 inches))

If yes, keep the image.

If you started with an 8 x 10, scanning at 72dpi and are happy with 
150ppi, you can get a good print out at 4 x 5. If you want 300ppi, then 
2 x 2.5 inches.. and so on.


Also, if working in .jpg filetypes, there is normally a quality setting 
in the paint program. If you're going to print, set it to the highest. 
If to the web, medium to medium high is generally not a noticeable 
difference. My testing showed that these settings affect the number 

Re: [PHP] How does one obtain the resolution of an image in PHP? [SOLVED]

2006-03-17 Thread Simon M. Campden-Main
Good morning, Edwin.

Thank you very much for taking the time to respond to my
query.

E See if you have ImageMagick installed.

I didn't, but do now.

E You could probably use the identify command to find
the info you need. For more information:
  $ man identify

It works, Edwin.  A tad slow (3 seconds to process a 762k
jpg), but the -verbose option does provide Resolution in
PPI.

E Of course, this solution is not *in* PHP but you can
invoke that program inside your PHP scripts (^_-)

Indeed!  For those following this thread, you can see the
various outputs at:
http://www.campden-main.com/~orchids/test/test_exif_2.php

Thanks to all and, until the next time, Take Care!
Simon
[EMAIL PROTECTED]

- Edwin - [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Hi!

 On Thu, 16 Mar 2006 08:13:41 -0800
 Simon M.  Campden-Main [EMAIL PROTECTED] wrote:

 [ . . . ]
 I want ppi!
 [ . . . ]
 I'm running the current Cent OS
 [ . . . ]

 See if you have ImageMagick installed. You could
 probably use the identify command to find the
 info you need. For more information:

  $ man identify

 Of course, this solution is not *in* PHP but you can
 invoke that program inside your PHP scripts (^_-)

 HTH,

 - Edwin -

 -- 
 Happy are the mild-tempered ones,
 since they will inherit the earth. - Matthew 5:5 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How does one obtain the resolution of an image in PHP?

2006-03-17 Thread - Edwin -
Hi!

On Fri, 17 Mar 2006 10:58:12 -0500
John Hinton wrote:

 - Edwin - wrote:
  Hi!
 
  On Thu, 16 Mar 2006 14:31:38 -0500
  John Hinton [EMAIL PROTECTED] wrote:
 

  Simon M. Campden-Main wrote:
  
  Well, there's the meat of it, isn't it?  I wonder how Paint
  Shop Pro comes up with PPI (Image - Image information). 
  I have several thousand scanned images with resolution
  ranging from 72 PPI up to 1200 PPI (As reported by Paint
  Shop Pro) and want to discard, or more likely tag as
  rejected, any that suffer a resolution of less than 150
  PPI.  As you might imagine, I find the thought of
  doing it manually with Paint Shop Pro repugnant.

 
  Okay, if it was scanned at 72ppi then you can't really print
  it out again even with a near-similar quality. However, having
  an image with a 72ppi does NOT necessarily mean that you
  have an image unsuitable for printing.
 

  PPI or pixels per inch is a printing term.
  
 
  Last time I checked, dpi is the printing term. (^_^)
 
dpi (dots per inch) - printer
ppi (pixels per inch) - monitor/screen
 

 Still missing it.. Yes, dpi is a printing term.. but has absolutely 
 nothing to with with images. dpi or Dots per Inch is purely a

I beg to differ... (see next)

 term that describes the limits of your printer. If for instance, we
 are talking about an ink jet printer with a 600 x 600 dpi
 capability, with black and three colors, that printer can print any
 of the four color or not print in a space 1/600th of an inch as it
 moves along. And there is no blending within that one dot... it's
 simply one of the colors or left the white or the paper color.
 
 One might think that an image should be scanned at 600 dpi to
 provide and equal quality, but really you can scan at a much
 reduced resolution and get the same results with a basic inkjet

At a much reduced resolution? Try scanning some photo, say
an A3 size photo, at 72ppi. Then, try printing that at 600dpi on
the same A3 size paper and see what you get.

 color printer, because the scan will most often be done at 16.7
 million colors.. the printer only has 4(+paper color) so it really
 takes a 4x4 dot area or so to start to get close to matching a
 single pixel. Now, lets don't even go there on printers. The above
 is greatly understated and was how old inkjets worked.. much has
 changed and I really haven't followed exactly what they are doing
 now, but obviously it seems that there is a blending over top of
 other colors in today's printers. Just trying to provide simple
 theory, quick to type, easy to grasp.

Add to that that some have 8(+paper color). And that not all
people are using inkjets.

 So, yet still ppi is being misrepresented.. Please stop doing this.

Who is misrepresenting what? ;-)

 If you don't believe me try this. Open a quality paint program. In
 fact, Macromedia's Fireworks in the image sizing dialog  box
 separates pixel dimensions from ppi putting ALL ppi function under
 the heading of Print Size. The example.
 
 Open or create an image 600 pixels x 300 pixels.
 
 Make sure you stay at 100% zoom factor.
 
 Set the printing Pixels/Inch to 150, but don't let the program
 change the Pixel dimensions. You will be given a print size of 4 x
 2. The image will take up 600 x 300 pixels of your monitor screen
 space.
 
 Now with that same image, change only the resolution to 300. Leave
 the pixel dimensions the same (one has to be careful with the
 locking of proportions and samplings to be sure the program doesn't
 change the pixel dimensions when changing the Pixel/Inch). You will
 now see that the print size is 2 x 1, but yet the image size on
 the screen has not changed sizes.

Of course!

 A pixel is a pixel to a monitor. A pixel is sent thru an algorithm
 on the way to a printer and by and large, print quality has to be
 much greater than monitor quality to 'look' as good. Basically, you
 can't get a 4 wide image on the screen to look as good when
 printed at 4 wide.

That's correct. And nobody said otherwise.

 A general guideline is images for print should be no less than 150
 ppi, newspaper quality, and 300 to 600 is recommended for color
 brochures and near photo quality. So, using our example above and
 assuming the printing company has requested 300 ppi images, that
 image at 600 x 300 which fills a major portion of one's monitor
 screen, can only be printed under this constraint at a maximum of 2
 inches x 1 inch. If you're going to print, check with the printer
 before beginning as print quality is generally rising at all levels.
 
 The question of throwing away all images with 72dpi is irrelevant.

  72dpi !== 72ppi

Just to make it consistent, an image on the screen cannot have
a dpi whereas a *printed* image can.

 The questions are:
 What resolution, pixels per inch, do you want to print at? Lets
 assume 300. What size are the images in pixels? Lets assume 1200 x
 900. (I know, odd size but easy math to follow)
 Are you happy 

[PHP] How does one obtain the resolution of an image in PHP?

2006-03-16 Thread Simon M. Campden-Main
Good morning, folks.

Can any one direct me to a snippet or suggest an approach to obtaining the
resolution of an image [file] with PHP.  exif_read_data() is great if the 
image
was taken with a camera that is exif compliant, but is no help with my 
scanned
images.  getimagesize() gives me height and width - not much help that I can
see. I want ppi!  I've no doubt that this is another case where the answer 
is
painfully obvious and my mind to dull, but I've spent the better part of the
day searching usenet groups and the PHP docs and come up with naught.
I'm running the current Cent OS distribution of EL, PHP Version 4.3.9 with, 
of
course, GD support. Any suggestions would be most appreciated.
Thank you.
Simon
[EMAIL PROTECTED]

 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] How does one obtain the resolution of an image in PHP?

2006-03-16 Thread Simon M. Campden-Main
Good morning, folks.

Can any one direct me to a snippet or suggest an approach to obtaining the
resolution of an image [file] with PHP.  exif_read_data() is great if the
image
was taken with a camera that is exif compliant, but is no help with my
scanned
images.  getimagesize() gives me height and width - not much help that I can
see. I want ppi!  I've no doubt that this is another case where the answer
is
painfully obvious and my mind to dull, but I've spent the better part of the
day searching usenet groups and the PHP docs and come up with naught.
I'm running the current Cent OS distribution of EL, PHP Version 4.3.9 with,
of
course, GD support. Any suggestions would be most appreciated.
Thank you.
Simon
[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How does one obtain the resolution of an image in PHP?

2006-03-16 Thread tedd

Good morning, folks.

Can any one direct me to a snippet or suggest an approach to obtaining the
resolution of an image [file] with PHP.  exif_read_data() is great if the
image
was taken with a camera that is exif compliant, but is no help with my
scanned
images.  getimagesize() gives me height and width - not much help that I can
see. I want ppi!  I've no doubt that this is another case where the answer
is
painfully obvious and my mind to dull, but I've spent the better part of the
day searching usenet groups and the PHP docs and come up with naught.
I'm running the current Cent OS distribution of EL, PHP Version 4.3.9 with,
of
course, GD support. Any suggestions would be most appreciated.
Thank you.
Simon


Simon:

There was a discussion on this a few weeks back -- you might look 
through the archives.


However, the bottom line was that images (other than exif notations) 
do not contain any resolution information because the resolution of 
any image is up to the method you wish to view it.


For example, if you take an image that is 1000 x 1000 pixels and wish 
to view it at 72 dpi, then the image size will be 13.8 x 13.8 inches. 
If you want to view it at 300 dpi, then the image size will be 3.33 
by 3.33 inches in size.


Understand?

tedd
--

http://sperling.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How does one obtain the resolution of an image in PHP?

2006-03-16 Thread Simon M. Campden-Main
Thank you for your response, Tedd.

T There was a discussion on this a few weeks back -- you might look through
the archives.

I'm reasonably certain I saw the thread but it was no help.  I will go back
and review it in case I missed something.

T However, the bottom line was that images (other than exif notations) do 
not
contain any resolution information because the resolution of any image is up 
to
the method you wish to view it.

Well, there's the meat of it, isn't it?  I wonder how Paint Shop Pro comes 
up
with PPI (Image - Image information).  I have several thousand scanned 
images
with resolution ranging from 72 PPI up to 1200 PPI (As reported by Paint 
Shop
Pro) and want to discard, or more likely tag as rejected, any that suffer a
resolution of less than 150 PPI.  As you might imagine, I find the thought 
of
doing it manually with Paint Shop Pro repugnant.

T For example, if you take an image that is 1000 x 1000 pixels and wish
to view it at 72 dpi, then the image size will be 13.8 x 13.8 inches.
If you want to view it at 300 dpi, then the image size will be 3.33
by 3.33 inches in size.
Understand?

I think so, but I am a bit dense.  I'm not concerned with image size but 
rather
native resolution.  Thanks again for taking the time.
Simon
[EMAIL PROTECTED]



tedd [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Good morning, folks.

Can any one direct me to a snippet or suggest an approach to obtaining the
resolution of an image [file] with PHP.  exif_read_data() is great if the
image
was taken with a camera that is exif compliant, but is no help with my
scanned
images.  getimagesize() gives me height and width - not much help that I 
can
see. I want ppi!  I've no doubt that this is another case where the answer
is
painfully obvious and my mind to dull, but I've spent the better part of 
the
day searching usenet groups and the PHP docs and come up with naught.
I'm running the current Cent OS distribution of EL, PHP Version 4.3.9 
with,
of
course, GD support. Any suggestions would be most appreciated.
Thank you.
Simon

 Simon:

 There was a discussion on this a few weeks back -- you might look through 
 the archives.

 However, the bottom line was that images (other than exif notations) do 
 not contain any resolution information because the resolution of any image 
 is up to the method you wish to view it.

 For example, if you take an image that is 1000 x 1000 pixels and wish to 
 view it at 72 dpi, then the image size will be 13.8 x 13.8 inches. If you 
 want to view it at 300 dpi, then the image size will be 3.33 by 3.33 
 inches in size.

 Understand?

 tedd
 -- 
 
 http://sperling.com 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How does one obtain the resolution of an image in PHP?

2006-03-16 Thread tedd

Simon:


Thank you for your response, Tedd.


No problem, glad to help if I can.


I think so, but I am a bit dense.  I'm not concerned with image size but
rather
native resolution.  Thanks again for taking the time.
Simon


Yes, but that's a different question.

On one hand, you have an image that can be presented in numerous resolutions.

On the other hand, how was the image first obtained?

Some images contain that information, but it's defined by the device 
that captured the image, for example:


http://www.exif.org/samples.html

In that data set is a host of other information, such as 
shutter-speed, flash, focal-length, camera make, model,  and such. 
Check out:


http://www.digicamhelp.com/what-is-exif/

If you want to access these data via php, check out:

http://us3.php.net/exif

But understand, not all images contain that information.

HTH's

tedd

--

http://sperling.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How does one obtain the resolution of an image in PHP?

2006-03-16 Thread tedd

Simon:

One more link:

http://www.weberdev.com/Manuals/PHP/function.exif-read-data.html

There's code there.

HTH's

tedd

--

http://sperling.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How does one obtain the resolution of an image in PHP?

2006-03-16 Thread Simon M. Campden-Main
Thanks again, Tedd.

I've checked out the links but still no luck.  As I stated (Or implied.)
in my first post, I have played with exif_read_data() but it is of little
use with the scanned images I've examined.  You can see results of my
experiments with  exif_read_data() and getimagesize() at:
http://www.campden-main.com/~orchids/test/test_exif.php

You'll note that if I simply divide the dimensions in pixels by the
dimensions in inches, I'll get the resolution in PPI.  Perhaps the solution
to my problem lies in simply finding a way to obtain the dimensions in 
inches
(As either exif_read_data() or getimagesize() will give me the dimensions in
pixels.) and just do the math.

Again, thanks for your help!
Simon
[EMAIL PROTECTED]

tedd [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Simon:

Thank you for your response, Tedd.

 No problem, glad to help if I can.

I think so, but I am a bit dense.  I'm not concerned with image size but
rather
native resolution.  Thanks again for taking the time.
Simon

 Yes, but that's a different question.

 On one hand, you have an image that can be presented in numerous 
 resolutions.

 On the other hand, how was the image first obtained?

 Some images contain that information, but it's defined by the device that 
 captured the image, for example:

 http://www.exif.org/samples.html

 In that data set is a host of other information, such as shutter-speed, 
 flash, focal-length, camera make, model,  and such. Check out:

 http://www.digicamhelp.com/what-is-exif/

 If you want to access these data via php, check out:

 http://us3.php.net/exif

 But understand, not all images contain that information.

 HTH's

 tedd

 -- 
 
 http://sperling.com 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How does one obtain the resolution of an image in PHP?

2006-03-16 Thread John Hinton

Simon M. Campden-Main wrote:


Well, there's the meat of it, isn't it?  I wonder how Paint Shop Pro comes 
up
with PPI (Image - Image information).  I have several thousand scanned 
images
with resolution ranging from 72 PPI up to 1200 PPI (As reported by Paint 
Shop

Pro) and want to discard, or more likely tag as rejected, any that suffer a
resolution of less than 150 PPI.  As you might imagine, I find the thought 
of

doing it manually with Paint Shop Pro repugnant.

  

PPI or pixels per inch is a printing term. It has nothing to do with
viewing on a monitor as a monitor's pixel setting is your set
resolution, as in 800x600, 1024x768, 1600x1200.. etc. This is a
constantly debated urban legend. A pixel on a monitor is a pixel...

Pixels per inch are used in the printing world and relates to how many
pixels are used to provide one inch of printed space. Obviously, at
least up to the limits of the printer being used, a high PPI setting
produces a higher quality 'printed' image.

If you don't believe me, use your paint program, change the PPI of an
image and notice how the image doesn't change size on the screen. Also,
do this and switch the image size display back and forth between inches
and pixels.. the pixel count doesn't change, only the inches change..
but again... that's the printing world and has nothing to do with
display on a monitor or webbrowser.

So, an image 10,000pixels by 10,000pixels will be huge on screen. If set
to a resolution of 1000ppi, the image would be printed at 10 x 10, but
you still can't view the whole image on a monitor without zooming out.
If resolution we set to 10,000dpi, the image would print as 1 x 1, but
you still wouldn't be able to view it on a monitor (unless you have an
awesome multi-display setup that can reach 10,000 pixels wide and tall).
That's the bottom line.

So, I keep seeing 'display size' when I'm thinking the term should be
'printed size'.

John Hinton

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How does one obtain the resolution of an image in PHP?

2006-03-16 Thread Richard Lynch
On Thu, March 16, 2006 1:31 pm, John Hinton wrote:
 Simon M. Campden-Main wrote:
 Well, there's the meat of it, isn't it?  I wonder how Paint Shop Pro
 comes
 up
 with PPI (Image - Image information).  I have several thousand
 scanned
 images
 with resolution ranging from 72 PPI up to 1200 PPI (As reported by
 Paint
 Shop
 Pro) and want to discard, or more likely tag as rejected, any that
 suffer a
 resolution of less than 150 PPI.  As you might imagine, I find the
 thought
 of
 doing it manually with Paint Shop Pro repugnant.


 PPI or pixels per inch is a printing term. It has nothing to do with
 viewing on a monitor as a monitor's pixel setting is your set
 resolution, as in 800x600, 1024x768, 1600x1200.. etc. This is a
 constantly debated urban legend. A pixel on a monitor is a pixel...

But there is SOME kind of data embedded in some images providing the
resolution at which they will/should be printed...

Because *SOMETIMES* http://php.net/getimagesize provides a reasonable
resolution in its result array.

'Course, sometimes it's full of crap, too...

Thing is, if you go changing those settings, and then save and then
print the two versions, you'll get quite different printer output.

So OBVIOUSLY the files are different, in some way that printers
understand, even if PHP only half-understands it.

'Twould be nice if PHP was as smart as a printer :-) :-) :-)

YMMV

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How does one obtain the resolution of an image in PHP?

2006-03-16 Thread - Edwin -
Hi!

On Thu, 16 Mar 2006 08:13:41 -0800
Simon M.  Campden-Main [EMAIL PROTECTED] wrote:

 [ . . . ]
 I want ppi! 
 [ . . . ]
 I'm running the current Cent OS
 [ . . . ]

See if you have ImageMagick installed. You could
probably use the identify command to find the
info you need. For more information:

  $ man identify

Of course, this solution is not *in* PHP but you can
invoke that program inside your PHP scripts (^_-)

HTH,

- Edwin -

-- 
Happy are the mild-tempered ones,
 since they will inherit the earth. - Matthew 5:5

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How does one obtain the resolution of an image in PHP?

2006-03-16 Thread Arnaldo Gandol
hi, I have troubles with strangers characters in my html pages, I've fixed
them by using mb_convert_encoding() function with  UTF-8  encoding  but I've
hear that mbstring library is unstable in some linux distributions. Does any
body knows how to solve this problem without using mbstring library. I'm
working with php-5.

Thank you beforehand.


Re: [PHP] How does one obtain the resolution of an image in PHP?

2006-03-16 Thread - Edwin -
Hi!

On Thu, 16 Mar 2006 14:31:38 -0500
John Hinton [EMAIL PROTECTED] wrote:

 Simon M. Campden-Main wrote:
 
  Well, there's the meat of it, isn't it?  I wonder how Paint
  Shop Pro comes up with PPI (Image - Image information). 
  I have several thousand scanned images with resolution
  ranging from 72 PPI up to 1200 PPI (As reported by Paint
  Shop Pro) and want to discard, or more likely tag as
  rejected, any that suffer a resolution of less than 150
  PPI.  As you might imagine, I find the thought of
  doing it manually with Paint Shop Pro repugnant.

Okay, if it was scanned at 72ppi then you can't really print
it out again even with a near-similar quality. However, having
an image with a 72ppi does NOT necessarily mean that you
have an image unsuitable for printing.

 PPI or pixels per inch is a printing term.

Last time I checked, dpi is the printing term. (^_^)

  dpi (dots per inch) - printer
  ppi (pixels per inch) - monitor/screen

 It has nothing to do with viewing on a monitor as a 
 monitor's pixel setting is your set resolution, as in
 800x600, 1024x768, 1600x1200.. etc. This is a 
 constantly debated urban legend. A pixel on a monitor
 is a pixel...

True.

 Pixels per inch are used in the printing world and relates to
 how many pixels are used to provide one inch of printed
 space. Obviously, at least up to the limits of the printer
 being used, a high PPI setting produces a higher quality
 'printed' image.

This really depends on how big the image is to be printed.
Besides, an image/photo taken using a digital camera (at
least mine) always defaults to 72ppi. BUT that does not
mean that it will come out badly printed at 300 dpi -- it
all depends on how big is the size (setting) of the picture
when I first took it.

 If you don't believe me, use your paint program, change the
 PPI of an image and notice how the image doesn't change size
 on the screen. Also, do this and switch the image size
 display back and forth between inches and pixels.. the pixel
 count doesn't change, only the inches change.. but again...
 that's the printing world and has nothing to do with display
 on a monitor or webbrowser.

True. This is basically because most monitors/screens are
actually at or near 72 ppi. screen !== printer (^_-)

 So, an image 10,000pixels by 10,000pixels will be huge on
 screen. If set to a resolution of 1000ppi, the image would be
 printed at 10 x 10, but you still can't view the whole
 image on a monitor without zooming out. If resolution we set
 to 10,000dpi, the image would print as 1 x 1, but you still
 wouldn't be able to view it on a monitor (unless you have an

I think you meant, ... but you still would be able ... 

 awesome multi-display setup that can reach 10,000 pixels wide
 and tall). That's the bottom line.
 
 So, I keep seeing 'display size' when I'm thinking the term
 should be 'printed size'.
 
 John Hinton

HTH  HAND,

- Edwin -

-- 
A capable wife is a crown to her owner. - Proverbs 12:4

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php