Question

Some files are uploaded with a reported MIME type:

image/x-citrix-pjpeg

They are valid jpeg files and I accept them as such.

I was wondering however: why is the MIME type different?
Is there any difference in the format? or was this mimetype invented by some light bulb at citrix for no apparent reason?

Was it helpful?

Solution

Update:
Ok, I did some more searching and testing on this question, and it turns out they're all lying about MIME-type (never trust any info send by the client, I know).
I've checked a bunch of files with different encodings (created with libjpeg)

Official MIME type for jpeg files: image/jpeg

But some applications (most notably MS Internet Explores but also Yahoo! mail) send jpeg files as image/pjpeg

I thought I knew that pjpeg stood for 'progressive' jpeg. It turns out that progressive/standard encoding has nothing to do with it.

MS Internet explorer send out all jpeg files as pjpeg regardless of the contents of the file.

The same goes for citrix: all jpeg files send from a citrix client are reported as the image/x-citrix-pjpeg MIME type.

The files themselves are untouched (identical before and after upload). So it turns out that difference in MIME type is only an indication the software used to send the file?

Why would people invent a new MIME type if there is no differences to the file contents?

OTHER TIPS

image/x-citrix-pjpeg seems to be the MIME type sent by images which are exported from a Citrix session.

I haven't come across any format differences between them and regular JPEGs - most image conversion utilities will handle them the same as a regular pjpeg, once the appropriate mime-type rule is added.

It's possible that in a Citrix session there is some internal magic done when managing jpegs which led them to create this mime-type, which they leave on the file when it's exported from their systems, but that's only my guess. As I say, I haven't noticed any actual format differences from the occasional files in this format we receive.

The closest i have come to find out what this is, is this thread. Hope it helps.

http://forums.citrix.com/message.jspa?messageID=713174

For some reason, when people are running Internet Explorer via Citrix, it changes the mime type for GIF and JPG files.

JPG: image/x-citrix-pjpeg
GIF: image/x-citrix-gif

Based on my testing, PNG files are not affected. I don't know if this is an Internet Explorer issue or Citrix.

It's to do with a feature of Citrix called SpeedBrowse, which intercepts jpegs and gifs in webpages on the [Citrix] server side, so that it can send them whole via ICA (the Citrix remoting protocol) -- this is more efficient than screen-scraping them. As a previous poster suggested, this is implemented by marking the images with a changed mime type.

IIRC it hooks FindMimeFromData in IE to change the mime type on the fly, but this is being applied to uploaded files as well as downloaded ones - surely a bug.

From what I recall the Progressive JPG format is the one that would allow the image to be shown with progressively higher resolution as the download of the file progressed. I am not entirely aware of the details, but if you remember back in the days of dial up, some files would show blurry, then better and eventually complete as they were downloaded. For this to work the data needs to be sent in a different order than a JPEG would typically be sent.

The actual data, once you view it, is identical it is just sent in a different order. The JPEG encoding itself may very well group pixels differently, I forget.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top