[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]
[XaraXtreme-commits] Commit Complete
Commit by : luke
Repository : xara
Revision : 878
Date : Tue Apr 25 10:40:35 BST 2006
Changed paths:
M /Trunk/XaraLX/Kernel/bitfilt.cpp
M /Trunk/XaraLX/Kernel/exjpeg.cpp
M /Trunk/XaraLX/Kernel/jpglib_namespace.h
JPEG exporting now working correctly. Using default options (ie no dialogs). Sub-optimal, bitmap rendered to 32 bit and then down-converted to 24 bit, but this matches the comments that are in the base bitmap filters so may be OK
Diff:
Index: Trunk/XaraLX/Kernel/jpglib_namespace.h
===================================================================
--- Trunk/XaraLX/Kernel/jpglib_namespace.h (revision 877)
+++ Trunk/XaraLX/Kernel/jpglib_namespace.h (revision 878)
@@ -113,7 +113,7 @@
{
extern "C"
{
- #include "jpeglib.h"
+ #include <jpeglib.h>
}
};
Index: Trunk/XaraLX/Kernel/exjpeg.cpp
===================================================================
--- Trunk/XaraLX/Kernel/exjpeg.cpp (revision 877)
+++ Trunk/XaraLX/Kernel/exjpeg.cpp (revision 878)
@@ -535,7 +535,8 @@
switch (ColourModel)
{
case libJPEG::JCS_RGB:
- m_ColourComponents = 4;
+ // This really should be RGB_PIXELSIZE (in jmorecfg.h), but this isn't exported!
+ m_ColourComponents = 3;
break;
case libJPEG::JCS_GRAYSCALE:
@@ -1281,12 +1282,15 @@
BMP_SIZE Width, Height;
BMP_DEPTH Depth;
ADDR pBitmapBits;
-
+
Ok = GetCurrentStripInfo(&pBitmapBits, &Width, &Height, &Depth);
+ // Create a converter from bitmap depth to export depth
+ DIBConvert* pConverter = DIBConvert::Create( Depth, GetRenderDepth(), Width, NULL );
+
if (Ok)
{
- Ok = WriteRawBitmap(pBitmapBits, Width, Height, Depth, NULL);
+ Ok = WriteRawBitmap( pBitmapBits, Width, Height, Depth, pConverter );
}
return Ok;
Index: Trunk/XaraLX/Kernel/bitfilt.cpp
===================================================================
--- Trunk/XaraLX/Kernel/bitfilt.cpp (revision 877)
+++ Trunk/XaraLX/Kernel/bitfilt.cpp (revision 878)
@@ -4709,8 +4709,6 @@
BMP_SIZE* pWidth, BMP_SIZE* pHeight,
BMP_DEPTH* pDepth) const
{
- PORTNOTETRACE("filters","BaseBitmapFilter::GetCurrentStripInfo - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
LPBITMAPINFO pBitmapInfo;
LPBYTE pBitmapBits;
@@ -4726,7 +4724,6 @@
*pWidth = pBitmapInfo->bmiHeader.biWidth;
*pHeight = pBitmapInfo->bmiHeader.biHeight;
*pDepth = pBitmapInfo->bmiHeader.biBitCount;
-#endif
return TRUE;
}
Xara