# Saves bitmap file with .JPG extension as image/jpeg

**URL:** https://community.mp3tag.de/t/saves-bitmap-file-with-jpg-extension-as-image-jpeg/10939
**Category:** No Bugs
**Created:** [October 13, 2010, 10:42pm UTC](https://community.mp3tag.de/t/saves-bitmap-file-with-jpg-extension-as-image-jpeg/10939 "2010-10-13T22:42:43Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![JoostM](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/df788c/32.png) [@JoostM](https://community.mp3tag.de/u/JoostM)
#### Post date: [October 13, 2010, 10:42pm UTC](https://community.mp3tag.de/t/saves-bitmap-file-with-jpg-extension-as-image-jpeg/10939/1 "2010-10-13T22:42:43Z")

</div>

I had a cover file with a .jpg extension. For some reason, it really was a BMP file - the first two bytes were 'BM'. mp3tag displays this file without problem, so it doesn't care much about the file extension, but it does use the file extension to determine mime type. This causes problems in mp3 players that rely on the mime type to display the image, for example WinAmp can't display a bitmap file if it has a image/jpg mime type.

Steps to reproduce:

1. Take a .bmp file
2. Change extension to .jpg
3. Set it as cover for an .mp3 file
4. Observe that mp3tag displays cover without problem
5. Observe that winamp can't display cover

I don't know what would be good to do here; maybe just display an error dialog that something is wrong, then the user can convert the open and save the file in an image editor.

I love mp3tag, by the way! I've been a happy user for years, and in fact still am 🙂

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [October 20, 2010, 1:32pm UTC](https://community.mp3tag.de/t/saves-bitmap-file-with-jpg-extension-as-image-jpeg/10939/2 "2010-10-20T13:32:29Z")

</div>

> [@JoostM](#):
>
> I had a cover file with a .jpg extension. For some reason, it really was a BMP file - the first two bytes were 'BM'. mp3tag displays this file without problem, so it doesn't care much about the file extension, but it does use the file extension to determine mime type. This causes problems in mp3 players that rely on the mime type to display the image, for example WinAmp can't display a bitmap file if it has a image/jpg mime type. ...

I walk with you on the bug way.  
Yes, it is possible to disguise **any** content, e. g. some text file, by adding the file extension ".jpg" to the existing file name and put this file disguised as cover art into the mp3 file.  
Mp3tag might display no cover picture but the data will be stored in the file.  
Later the data can be extracted, without any change, back to the original format.

Basically this is a wanted behaviour of the "cover art container" - in and out of data without changing anything - still having the original unchanged binary content.

But I tend to say, that it is a heavy bug and that such behaviour carries a high risk and is a security problem at all.

DD.20101020.1732.CEST

---

<div class="post-metadata">

### Author: ![JoostM](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/df788c/32.png) [@JoostM](https://community.mp3tag.de/u/JoostM)
#### Post date: [October 20, 2010, 4:18pm UTC](https://community.mp3tag.de/t/saves-bitmap-file-with-jpg-extension-as-image-jpeg/10939/3 "2010-10-20T16:18:57Z")

</div>

So the best thing would be to do a check when loading a new cover file - if it's really not a JPEG, warn the user and have him decide if he wants to continue, because in nearly every case, it's a mistake to put something other than a JPEG into an mp3. Many media players are unable to display PNG and BMP files, because they all assume that JPEG is the dominant format.

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [December 28, 2018, 2:30pm UTC](https://community.mp3tag.de/t/saves-bitmap-file-with-jpg-extension-as-image-jpeg/10939/4 "2018-12-28T14:30:06Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
