views:

1573

answers:

5

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?

A: 

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

Ólafur Waage
Doesn't really answer the question, it only provides a workaround.
Jacco
+4  A: 

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.

ConroyP
So it might be that they change the MIME type to internally mark it for some undisclosed reason.
Jacco
That's my thinking, yes, maybe some sort of special image handler internally that marks images in a usable format for their system. And the export of the file just doesn't bother to remove the mark. Not a lot of documentation out there on it!
ConroyP
my wild guess will be that in any terminal services session depending on your settings you may lose some colours (say reduce depth from 24bit to 16bit). So they (Citrix, MS etc) MAY have reserved a possibility of telling another end that you are working with a client in a TS sesssion - you may choose to generate your images differently to make safer with higher chances to preserve colours. But this is only my guess - don't take it too seriously.
DmitryK
+3  A: 

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?

Jacco
+1  A: 

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.

Otto
+1  A: 

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.

Paul Lloyd