mirror of
https://github.com/privacore/open-source-search-engine.git
synced 2025-07-17 02:56:07 -04:00
image formatting fixes
This commit is contained in:
@ -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
|
||||
|
3
Images.h
3
Images.h
@ -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
|
||||
|
Reference in New Issue
Block a user