Closed Bug 27365 Opened 25 years ago Closed 24 years ago

Image type displayed when viewing an image is not correct; it is just the image file's extension...

Categories

(Core :: Graphics: ImageLib, defect, P3)

All
Windows 98
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: doronr, Assigned: attinasi)

Details

If I view an image, it opens the new window, and the title of the new mozilla
window is "Image". In NS4.x, you get for example "JPEG image widthxheight"

This is with nightly build 2000020919.
Nisheeth:
Looks like we ask for the w&h before the imagelib has
had a chance to decode the header. So both w & h are zero
and nothing displays when nsImageDocument::UpdateTitle() is called.

I'm passing this to you, but if you need my help, call.
-P
Assignee: pnunn → nisheeth
Re-assigning this Marc as per our conversation...
Assignee: nisheeth → attinasi
Fixed. Changes in nsImageDocument.cpp: Moved the SetTitle call to the EndLayout 
method so the ImageLib has had a chance to get the size in all cases. Checkin 
pending review.
Status: NEW → ASSIGNED
Moved the UpdateTitle call to after the doc is loaded to ensure the dimensions 
have been determined. r=pnunn
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Re-opening on grounds that 4.x actually says image type (e.g. GIF or JPEG) and 
dimensions, whereas Seamonkey now only says dimensions.

(If you'd prefer that this be split off into a separate enhancement request, or 
punted on entirely, just re-resolve the bug with your comments. Thanks!)
Oops.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Status: REOPENED → ASSIGNED
using 2000022708, no image size is shown.  Seems that something has happened.
Any idea as to why?
I just checked it with a build made from sources pulled on 3/1 and it is still 
working (at least the size is being displayed: the file type is another story. I 
have changes to put the file extension in as the file type, however I want to 
use the MIME to get the file type instead, since we support arbitrary image 
formats that may have names other that are different from their extension).

I've changed the summary to reflect the part that still needs to be done.
Summary: viewing image does not show name + info in title/header → viewing image does not show the image type in title
on win32 2000030308 build (m15 nightly), viewing image on top of this page has
only the text "Mozilla" in the header.  Also seen on m14 release

for example, http://www.thehungersite.com/images/site_TrusteFinalMark.gif

it loads fine, but in the console, get this: "Error loading URL
http://www.thehungersite.com/images/site_TrusteFinalMark.gif"

this was seen on linux and win32 (not just me).

however, viewing a image on the hardisk does show the image dimensions! attinasi
- can you view a non-local image and get it's dimensions?


Hardware: PC → All
Yes, I can load the image fine over the net. The error you are getting loading 
the image may be a clue: the title and dimensions are set when the image is 
completed loading and the image loader notifies the ImageDocument. If there is 
an error loading the image it may not get called and hence no title. There have 
been times when the call was not being made (no notification from the image 
loader) so the title was not getting set, but this was fixed - unless it is 
broken again. 

It is working for me in my local build, and in the daily builds downloaded from 
Mozilla.org on 3/1 and todays daily dated 3/3, buildID 2000030313. Maybe you can 
try the most recent daily?
Ok, here is what we found out after soem discussion over at #mozillazine:

Close all moz windows, open moz, and view
http://www.thehungersite.com/images/site_TrusteFinalMark.gif

This works.

now, open another window, and view the exact image. No one got the image
dimensions in the second window.

It seems that the header is not updated.  Whenever the image header is not
loaded, the header of the previous url is kept.

here is a test, seen on m14 and m15 - view the image in the first window, go to
other url (cnn.com), view image again, no dimensions, i get the old header (of cnn)

using http://www.thehungersite.com/images/site_TrusteFinalMark.gif as test image

Can you see this?  my guess is that the header is not updated when a image is
loaded after viewing another url.



I see it (the problem) in the second window. The EndLayout callback is never 
being called so the title is never getting updated (nsImageDocument.cpp). 

Now I need to figure out why the EndLayout is not being called in a second 
window now... Thanks for all of the information on this one.
The regression on the image dimensions not showing up (on a second window) has 
been fixed and is awaiting post-beta1 checkin. The image type is the part left 
to do.
Target Milestone: M16
Target Milestone: M16 → M20
attinasi - everything seem to work in the new nightlies. Think this can be closed
Thanks for the note: I'm going to reword the summary to reflect the fact that 
the Image Type is just the extension and not really the image type. 

This is only a problem if the image type does not correspond to the extension, 
and since we support arbitrary image types through loadable modules (I am told) 
this will not really be the correct behavior. It is not, however, very important 
at this time, so I'm also marking REMIND for post-beta (probably post Gecko 1) 
work.

Many thanks, doronr and elig for your help.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago24 years ago
Resolution: --- → REMIND
Summary: viewing image does not show the image type in title → Image type displayed when viewing an image is not correct; it is just the image file's extension...
Rubber-stamping as Verified/REMIND.
Status: RESOLVED → VERIFIED
Reopening to reclose...
Status: VERIFIED → REOPENED
Resolution: REMIND → ---
This has been fixed: we no longer display the image extension. I opened another
bug previously abou tneeding the imag type from nsIImage.
Status: REOPENED → RESOLVED
Closed: 24 years ago24 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.