7 Replies - 529 Views - Last Post: 25 January 2012 - 11:55 AM

#1 hcccs  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 22
  • Joined: 15-January 12

Difference between versions of the same picture

Posted 25 January 2012 - 05:10 AM

I have two version of the same picture, 300x400 px, 72 p/i, but one is gray-scale and the other 24-bit color. I have identical code in a web test page and the color picture is shown and the other comes up as the little square with a red 'x' in it. I created the gray-scale picture from the color picture. What could possibly be the problem here, some hidden metadata or has the pic become corrupted in some way?
Is This A Good Question/Topic? 0
  • +

Replies To: Difference between versions of the same picture

#2 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3710
  • View blog
  • Posts: 5,958
  • Joined: 08-June 10

Re: Difference between versions of the same picture

Posted 25 January 2012 - 06:07 AM

I assume you've double and triple checked the URL in the web page vs the actual name of the picture?

If this is a webpage, try copying the URL of the image your browser is trying to show and navigate there directly. If you get a 404 error your browser can't find the image. Otherwise you should get some sort an error, or possibly a download dialog.
Was This Post Helpful? 0
  • +
  • -

#3 stayscrisp  Icon User is offline

  • フカユ
  • member icon

Reputation: 998
  • View blog
  • Posts: 4,173
  • Joined: 14-February 08

Re: Difference between versions of the same picture

Posted 25 January 2012 - 07:53 AM

I'm going to move this to web development. You may get more help in there.
Was This Post Helpful? 0
  • +
  • -

#4 hcccs  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 22
  • Joined: 15-January 12

Re: Difference between versions of the same picture

Posted 25 January 2012 - 08:06 AM

View PostAtli, on 25 January 2012 - 01:07 PM, said:

I assume you've double and triple checked the URL in the web page vs the actual name of the picture?

If this is a webpage, try copying the URL of the image your browser is trying to show and navigate there directly. If you get a 404 error your browser can't find the image. Otherwise you should get some sort an error, or possibly a download dialog.


Yes, I've checked. This is the code:
<h1>Test page</h1>
<div>
	<img src="/pics/voo/hasse.jpg" alt="hasse" />
	<img src="/pics/voo/h.jpg" alt="h" />
</div>



The file hasse.jpg is shown and h.jpg is not. When I run directly in the browser like this:

C:\inetpub\wwwroot\pics\voo\hasse.jpg
C:\inetpub\wwwroot\pics\voo\h.jpg

both are displayed correctly. It must have something to do with the file itself but I can't figure out what.
Was This Post Helpful? 0
  • +
  • -

#5 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3710
  • View blog
  • Posts: 5,958
  • Joined: 08-June 10

Re: Difference between versions of the same picture

Posted 25 January 2012 - 08:29 AM

Are you also viewing the HTML file using a local file-system location, or are you using a localhost URL?

If you are loading this via a local-file system URL then the root of the URL would be the root of the hard-drive ("C:\") rather than the web-root a HTTP server would use ("C:\inetpub\wwwroot\"). - The URL "/pics/voo/v.jpg" would refer to "C:\pics\voo\v.jpg" rather than "C:\inetpub\wwwroot\pics\voo\h.jpg".

That should affect both images though. What happens if you request the images through the HTTP server? Something like: http://localhost/pics/voo/h.jpg.
Was This Post Helpful? 0
  • +
  • -

#6 hcccs  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 22
  • Joined: 15-January 12

Re: Difference between versions of the same picture

Posted 25 January 2012 - 08:35 AM

View PostAtli, on 25 January 2012 - 03:29 PM, said:

Are you also viewing the HTML file using a local file-system location, or are you using a localhost URL?

If you are loading this via a local-file system URL then the root of the URL would be the root of the hard-drive ("C:\") rather than the web-root a HTTP server would use ("C:\inetpub\wwwroot\"). - The URL "/pics/voo/v.jpg" would refer to "C:\pics\voo\v.jpg" rather than "C:\inetpub\wwwroot\pics\voo\h.jpg".

That should affect both images though. What happens if you request the images through the HTTP server? Something like: http://localhost/pics/voo/h.jpg.


I get the reply 'You are not authorized to view this page'.
I still think there is something peculiar with one of the files. Is there a piece of S/W you can use to extract all the info there is about a certain file?
Was This Post Helpful? 0
  • +
  • -

#7 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3710
  • View blog
  • Posts: 5,958
  • Joined: 08-June 10

Re: Difference between versions of the same picture

Posted 25 January 2012 - 08:56 AM

If you can open the picture in the browser using a local path then the browser should be able to open in as a part of a website. Why do you think the picture itself is peculiar? - You could just open it in Photoshop or GIMP and export it again as a new image. That should take care of any such issues.

I don't know any software to examine images like that. Maybe something like Photoshop or GIMP can show you the image meta-data, or something like Google's Picasa. I've never attempted this though.

Quote

I get the reply 'You are not authorized to view this page'.

Try to give Everybody access to read all three files, then try it again. I'm not sure exactly how IIS handles permissions but if it's reading them from the file-system then that should take care of it.

This post has been edited by Atli: 25 January 2012 - 08:57 AM

Was This Post Helpful? 2
  • +
  • -

#8 hcccs  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 22
  • Joined: 15-January 12

Re: Difference between versions of the same picture

Posted 25 January 2012 - 11:55 AM

View PostAtli, on 25 January 2012 - 03:56 PM, said:

...
Try to give Everybody access to read all three files, then try it again. I'm not sure exactly how IIS handles permissions but if it's reading them from the file-system then that should take care of it.


You found it! I checked the two files and only one had permissions for a user to read it so I changed the other file and gave 'Users(<computer name>\Users) read access to it and now it works. I use PaintShop Pro to alter picture files and assumed that the new file inherited the permisssion but obsiously it isn't so.Great help. Thanks!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1