image formatting fixes

This commit is contained in:
mwells
2014-05-11 07:06:35 -07:00
parent 2d6bc12866
commit 533a6caef7
3 changed files with 9 additions and 3 deletions

@ -1171,7 +1171,9 @@ bool ThumbnailInfo::printThumbnailInHtml ( SafeBuf *sb ,
long maxWidth ,
long maxHeight,
bool printLink ,
long *retNewdx ) {
long *retNewdx ,
char *style ) {
if ( ! style ) style = "";
// account for scrollbar on the right
//maxSide -= (long)SCROLLBAR_WIDTH;
// avoid distortion.
@ -1190,10 +1192,12 @@ bool ThumbnailInfo::printThumbnailInHtml ( SafeBuf *sb ,
long newdy = (long)((float)m_dy * min);
if ( printLink ) sb->safePrintf("<a href=%s>", getUrl() );
sb->safePrintf("<img width=%li height=%li align=left "
"%s"
"src=\"data:image/"
"jpg;base64,"
, newdx
, newdy
, style
);
// encode image in base 64
sb->base64Encode ( getData(), m_dataSize , 0 ); // 0 niceness

@ -32,7 +32,8 @@ class ThumbnailInfo {
long maxWidth,
long maxHeight,
bool printLink ,
long *newdx ) ;
long *newdx ,
char *style = NULL ) ;
};
// XmlDoc::ptr_imgData is a ThumbnailArray

@ -2705,7 +2705,8 @@ bool printResult ( State0 *st, long ix , long numPrintedSoFar ) {
100 , // max width
100 , // max height
true , // add <a href>
NULL );
NULL ,
" style=\"margin:10px;\" ");
}
// print image for widget