public synchronized int getWorkQueueSize() {
return workQueue.size();
}
private void generateThumbnail() {
QByteArray js = new QByteArray();
logger.log(logger.HIGH, "Starting thumbnail for " +guid);
ArrayList<QTemporaryFile> tempFiles = new ArrayList<QTemporaryFile>();
Note currentNote = conn.getNoteTable().getNote(guid,true,true,false,true,false);
NoteFormatter formatter = new NoteFormatter(logger, conn, tempFiles);
currentNote = conn.getNoteTable().getNote(guid, true, true, false, true, false);
formatter.setNote(currentNote, true);
formatter.setHighlight(null);
js.append("<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">");
js.append("<style type=\"text/css\">.en-crypt-temp { border-collapse:collapse; border-style:solid; border-color:blue; padding:0.0mm 0.0mm 0.0mm 0.0mm; }</style>");
js.append("<style type=\"text/css\">en-hilight { background-color: rgb(255,255,0) }</style>");
js.append("<style> img { max-width:100%; }</style>");
js.append("<style type=\"text/css\">en-spell { text-decoration: none; border-bottom: dotted 1px #cc0000; }</style>");
js.append("</head>");
js.append(formatter.rebuildNoteHTML());
js.append("</HTML>");
js.replace("<!DOCTYPE en-note SYSTEM 'http://xml.evernote.com/pub/enml.dtd'>", "");
js.replace("<!DOCTYPE en-note SYSTEM 'http://xml.evernote.com/pub/enml2.dtd'>", "");
js.replace("<?xml version='1.0' encoding='UTF-8'?>", "");
int zoom = 1;
if (currentNote != null && currentNote.getContent() != null) {
String content = currentNote.getContent();
zoom = Global.calculateThumbnailZoom(content);
}