What is the difference between: image/x-citrix-pjpeg and image/pjpeg
Asked Answered
G

6

11

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?

Gangplank answered 14/10, 2008 at 12:16 Comment(0)
G
12

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?

Gangplank answered 14/3, 2009 at 16:15 Comment(0)
S
5

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.

Suzansuzann answered 14/10, 2008 at 12:34 Comment(3)
So it might be that they change the MIME type to internally mark it for some undisclosed reason.Gangplank
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!Suzansuzann
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.Mufti
T
2

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

Tackle answered 14/10, 2008 at 12:33 Comment(2)
Doesn't really answer the question, it only provides a workaround.Gangplank
As of 2019-09-27, this link no longer exists.Canzona
H
2

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.

Hasdrubal answered 18/8, 2009 at 23:42 Comment(0)
T
2

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.

Tonyatonye answered 8/4, 2010 at 13:45 Comment(0)
W
1

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.

Wainwright answered 21/3, 2012 at 16:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.