1

Today I was reading an article online and while looking at the photo accompanying it I noticed some chromatic aberration that I found interesting (wanted to figure out if it was a camera artifact or added as a post effect), so I decided to take a closer look in Photoshop.

However, when I tried to open it, I got this error:

Could not open “Security_zoom_1137878047.jpg” because an unknown or invalid JPEG marker type is found.

Here is the original photo.

In this particular case I don't need to edit the photo, and if I did I could always just take a screen shot (as I did of the 'H' above). But it got me thinking maybe I should learn how to work with these kinds of images, and maybe even learn how to make them.

When opened in TextEdit the file begins with this:

So, finding it odd that web browsers can display this file but an image editor can't, I did some searching and found a page that offered some clues. The page is titled Viewing a WEBPVP8 image in a RIFF file (it is not https:// so I'm not linking to it, but you can find it with a search engine). Although the gist of it is: It's a WEBPVP8 image (is that the same as WebP?) and it can be opened in a browser, but not Photoshop.

Also, as a test I converted this image to a regular JPEG using https://ezgif.com/webp-to-jpg

The resulting file can be opened by Photoshop.

Now knowing I can convert and open such files, my remaining questions are:

  1. What kind of file is this really, JPEG or WebP with a .jpg extension?
  2. Under what circumstances would someone save a file in this format?
  3. How would one save a file in this format?
8
  • You shoudl probably convert webp to png if your purpose was to edit it,
    – joojaa
    Apr 2 '20 at 8:06
  • @joojaa In this case I'm not going to edit the photo. But yes, PNG would be better than JPEG if editing. I'm just trying to find out what's up with this strange .jpg that acts like a .webp and needs to be converted to a "proper" .jpg before Ps will handle it. All the article images on WIRED currently use this format. I'm sure there's a good reason, but I don't know what that reason is.
    – Mentalist
    Apr 2 '20 at 8:16
  • the file ending is just text in the name. Anybody can write anything they like in the file ending, Its simply a WebP image. Nothing stops me renaming jpegs as txt or webp as jpeg. Probably this was done to expedite teh use of webp so they wouldnt need to reconfigure their server.
    – joojaa
    Apr 2 '20 at 8:22
  • @joojaa That theory makes sense. To test it I changed the .jpg extension to .webp - interestingly, Chrome will open it but Firefox will not (although Firefox also supports WebP). This makes me suspect it wasn't originally a .webp and Chrome is just less strict about extensions and header info matching up. Mysteries...
    – Mentalist
    Apr 2 '20 at 8:34
  • Also there are useful reasons to alter ending, reading software often do not recognize the files by the ending but read the binary header instead, so they dont care. But the OS does so if you want to pair a image with a second set of software than usual then you can just alter the ending.
    – joojaa
    Apr 2 '20 at 8:35
2

File ending is just metadata in the filename. Nobody is forced to use the file ending that corresponds with file type. In fact there are lots of lesser known file endings that have several applications that want to associate themselves with the ending.*

(1) This file is a WebP image. Applications that support the file often do not care of the ending they will just read the header to determine what the file is. However the operating system may disagree with you. The probable reason is that somebody wanted to avoid changing metadata in their server.

This can be extremely useful, I use it for EPS files all the time. What I do is call them epsX files and that type is associated with a script launcher. This allows me to embed the image in adobe software. But when i ask to edit the file it does not open it in illustrator (even in illustrator) but a custom dialog tailored for that file.. SO i can make custom GUIS for files but still use it as a EPS at the same time.

* Also you'd be surprised how many file formats are just zip files.

Edit by Mentalist:

(2) Now knowing this is a WebP file, a reason one might choose to save in that format is:

Google claims that webp reduces the size of images significantly in comparison to png and jpg. It reduces the file size in comparison to png images by up to 26%, and by up to 34% in comparison to jpg images. Source

Browser support for WebP

(3) Here's how to save a WebP file using Photoshop (with a plugin). There are also web applications (such as this one) that can convert images to WebP from other formats.

1
  • Thanks for posting an answer! I added a couple of points to directly address those that I mentioned in my question. I hope you don't mind.
    – Mentalist
    Apr 2 '20 at 11:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.