Opened 10 years ago

Closed 10 years ago

#699 closed defect (fixed)

BMP: support BMP OS/2 v2 with RLE compression

Reported by: ami_stuff Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords: bmp
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

The attached file decodes correctly in IrfanView/Photoshop.

Seems like header check should be modified to support this file:

libavcodec/bmp.c:

    depth = bytestream_get_le16(&buf);

//    if(ihsize == 40)
        comp = bytestream_get_le32(&buf);
//    else
//        comp = BMP_RGB;

    if(comp != BMP_RGB && comp != BMP_BITFIELDS && comp != BMP_RLE4 && comp != BMP_RLE8){

Attachments (1)

bmp.bmp (778.4 KB ) - added by ami_stuff 10 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 by ami_stuff, 10 years ago

C:\>ffmpeg -i bmp.bmp
ffmpeg version N-35295-gb55dd10, Copyright (c) 2000-2011 the FFmpeg developers
  built on Nov 30 2011 00:52:52 with gcc 4.6.2
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-ru
ntime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libope
ncore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --en
able-libmp3lame --enable-libopenjpeg --enable-librtmp --enable-libschroedinger -
-enable-libspeex --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwben
c --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-
libxvid --enable-zlib
  libavutil    51. 29. 1 / 51. 29. 1
  libavcodec   53. 39. 1 / 53. 39. 1
  libavformat  53. 22. 0 / 53. 22. 0
  libavdevice  53.  4. 0 / 53.  4. 0
  libavfilter   2. 50. 0 /  2. 50. 0
  libswscale    2.  1. 0 /  2.  1. 0
  libpostproc  51.  2. 0 / 51.  2. 0
Input #0, image2, from 'bmp.bmp':
  Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: bmp, pal8, 1023x767, 25 tbr, 25 tbn, 25 tbc
At least one output file must be specified

by ami_stuff, 10 years ago

Attachment: bmp.bmp added

comment:2 by ami_stuff, 10 years ago

"the major difference between v1.x and v2.x files is the size of the bitmap header. This header is 14 bytes in length in v1.x BMP files and is 64 bytes in length in v2.x files."

and this seems to work

   if(ihsize == 40 || ihsize == 64)

comment:3 by Carl Eugen Hoyos, 10 years ago

Component: undeterminedavcodec
Keywords: bmp added
Reproduced by developer: set
Status: newopen
Version: unspecifiedgit-master

Please consider sending a patch to ffmpeg-devel.

comment:4 by Carl Eugen Hoyos, 10 years ago

Resolution: fixed
Status: openclosed

Fixed by ami_stuff and Peter Ross.

Note: See TracTickets for help on using tickets.