You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openmeetings.apache.org by so...@apache.org on 2017/03/28 03:19:17 UTC

svn commit: r1789036 [1/2] - in /openmeetings/application: branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/ branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/file/ branches/3.2.x/open...

Author: solomax
Date: Tue Mar 28 03:19:16 2017
New Revision: 1789036

URL: http://svn.apache.org/viewvc?rev=1789036&view=rev
Log:
[OPENMEETINGS-551] basic work on image/video wb upload; code clean-up

Added:
    openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/DocumentConverter.java
      - copied, changed from r1789035, openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/GeneratePDF.java
    openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/ImageConverter.java
      - copied, changed from r1789035, openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/GenerateImage.java
    openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/arrow.png   (with props)
    openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/disk.png   (with props)
    openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/ellipse.png   (with props)
    openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/font.png   (with props)
    openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/line.png   (with props)
    openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/next.png   (with props)
    openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/paintbrush.png   (with props)
    openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/plus_icon.png   (with props)
    openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/plus_icon_disabled.png   (with props)
    openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/pointer.png   (with props)
    openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/prev.png   (with props)
    openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/rectangle.png   (with props)
    openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/uline.png   (with props)
    openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/wbpointer.png   (with props)
    openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/DocumentConverter.java
      - copied, changed from r1789035, openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/GeneratePDF.java
    openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/ImageConverter.java
      - copied, changed from r1789035, openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/GenerateImage.java
Removed:
    openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/GenerateImage.java
    openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/GenerateThumbs.java
    openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/GeneratePDF.java
    openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/arrow_down.png
    openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/arrow_right.png
    openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/forms/
    openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/GenerateImage.java
    openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/GenerateThumbs.java
    openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/GeneratePDF.java
Modified:
    openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/BaseConverter.java
    openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/FlvExplorerConverter.java
    openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/file/FileProcessor.java
    openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/util/WebSocketHelper.java
    openmeetings/application/branches/3.2.x/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java
    openmeetings/application/branches/3.2.x/openmeetings-util/src/main/java/org/apache/openmeetings/util/OpenmeetingsVariables.java
    openmeetings/application/branches/3.2.x/openmeetings-util/src/main/java/org/apache/openmeetings/util/process/ProcessHelper.java
    openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/admin/groups/GroupForm.java
    openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/UploadableProfileImagePanel.java
    openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.html
    openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomResourceReference.java
    openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/room.js
    openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/chat/Chat.java
    openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/WEB-INF/classes/openmeetings-applicationContext.xml
    openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/forms.css
    openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/room.css
    openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/theme.css
    openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/BaseConverter.java
    openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/FlvExplorerConverter.java
    openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/file/FileProcessor.java
    openmeetings/application/trunk/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java
    openmeetings/application/trunk/openmeetings-util/src/main/java/org/apache/openmeetings/util/OpenmeetingsVariables.java
    openmeetings/application/trunk/openmeetings-util/src/main/java/org/apache/openmeetings/util/process/ProcessHelper.java
    openmeetings/application/trunk/openmeetings-web/src/main/java/org/apache/openmeetings/web/admin/groups/GroupForm.java
    openmeetings/application/trunk/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/UploadableProfileImagePanel.java
    openmeetings/application/trunk/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/WbPanel.java
    openmeetings/application/trunk/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/wb.js
    openmeetings/application/trunk/openmeetings-web/src/main/webapp/WEB-INF/classes/openmeetings-applicationContext.xml

Modified: openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/BaseConverter.java
URL: http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/BaseConverter.java?rev=1789036&r1=1789035&r2=1789036&view=diff
==============================================================================
--- openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/BaseConverter.java (original)
+++ openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/BaseConverter.java Tue Mar 28 03:19:16 2017
@@ -23,6 +23,7 @@ import static org.apache.openmeetings.ut
 import static org.apache.openmeetings.util.OmFileHelper.EXTENSION_JPG;
 import static org.apache.openmeetings.util.OmFileHelper.getRecordingMetaData;
 import static org.apache.openmeetings.util.OmFileHelper.getStreamsSubDir;
+import static org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_IMAGEMAGIC_PATH;
 import static org.apache.openmeetings.util.OpenmeetingsVariables.webAppRootKey;
 
 import java.io.File;
@@ -32,7 +33,10 @@ import java.util.Arrays;
 import java.util.Date;
 import java.util.List;
 import java.util.concurrent.TimeUnit;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
+import org.apache.directory.api.util.Strings;
 import org.apache.openmeetings.db.dao.basic.ConfigurationDao;
 import org.apache.openmeetings.db.dao.record.RecordingMetaDataDao;
 import org.apache.openmeetings.db.dao.record.RecordingMetaDeltaDao;
@@ -50,6 +54,7 @@ import org.springframework.beans.factory
 
 public abstract class BaseConverter {
 	private static final Logger log = Red5LoggerFactory.getLogger(BaseConverter.class, webAppRootKey);
+	private static final Pattern p = Pattern.compile("\\d{2,5}(x)\\d{2,5}");
 
 	@Autowired
 	private ConfigurationDao configurationDao;
@@ -58,9 +63,19 @@ public abstract class BaseConverter {
 	@Autowired
 	private RecordingMetaDeltaDao metaDeltaDao;
 
+	protected static class Dimension {
+		public int width = 0;
+		public int height = 0;
+
+		public Dimension(int width, int height) {
+			this.width = width;
+			this.height = height;
+		}
+	}
+
 	private String getPath(String key, String app) {
 		String path = configurationDao.getConfValue(key, String.class, "");
-		if (!"".equals(path) && !path.endsWith(File.separator)) {
+		if (!Strings.isEmpty(path) && !path.endsWith(File.separator)) {
 			path += File.separator;
 		}
 		path += app;
@@ -75,12 +90,12 @@ public abstract class BaseConverter {
 		return getPath("sox_path", "sox");
 	}
 
-	protected String getPathToImageMagick() {
-		return getPath("imagemagick_path", "convert") + GenerateSWF.execExt;
+	protected String getPathToConvert() {
+		return getPath(CONFIG_IMAGEMAGIC_PATH, "convert") + GenerateSWF.execExt;
 	}
 
-	protected boolean isUseOldStyleFfmpegMap() {
-		return "1".equals(configurationDao.getConfValue("use.old.style.ffmpeg.map.option", String.class, "0"));
+	protected String getPathToIdentify() {
+		return getPath(CONFIG_IMAGEMAGIC_PATH, "identify") + GenerateSWF.execExt;
 	}
 
 	protected File getStreamFolder(Recording recording) {
@@ -380,4 +395,16 @@ public abstract class BaseConverter {
 
 		returnLog.add(ProcessHelper.executeScript("generate preview JPG", argv));
 	}
+
+	protected static Dimension getDimension(String txt) {
+		Matcher matcher = p.matcher(txt);
+
+		while (matcher.find()) {
+			String foundResolution = txt.substring(matcher.start(), matcher.end());
+			String[] resultions = foundResolution.split("x");
+			return new Dimension(Integer.valueOf(resultions[0]).intValue(), Integer.valueOf(resultions[1]).intValue());
+		}
+
+		return new Dimension(100, 100); // will return 100x100 for non-video to be able to play
+	}
 }

Copied: openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/DocumentConverter.java (from r1789035, openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/GeneratePDF.java)
URL: http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/DocumentConverter.java?p2=openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/DocumentConverter.java&p1=openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/GeneratePDF.java&r1=1789035&r2=1789036&rev=1789036&view=diff
==============================================================================
--- openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/GeneratePDF.java (original)
+++ openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/DocumentConverter.java Tue Mar 28 03:19:16 2017
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.openmeetings.core.documents;
+package org.apache.openmeetings.core.converter;
 
 import static org.apache.openmeetings.core.documents.CreateLibraryPresentation.generateXMLDocument;
 import static org.apache.openmeetings.util.OmFileHelper.EXTENSION_PDF;
@@ -24,8 +24,6 @@ import static org.apache.openmeetings.ut
 
 import java.io.File;
 
-import org.apache.openmeetings.core.converter.GenerateSWF;
-import org.apache.openmeetings.core.converter.GenerateThumbs;
 import org.apache.openmeetings.db.dao.basic.ConfigurationDao;
 import org.apache.openmeetings.db.entity.file.FileExplorerItem;
 import org.apache.openmeetings.util.process.ConverterProcessResult;
@@ -39,15 +37,15 @@ import org.red5.logging.Red5LoggerFactor
 import org.slf4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 
-public class GeneratePDF {
-	private static final Logger log = Red5LoggerFactory.getLogger(GeneratePDF.class, webAppRootKey);
+public class DocumentConverter {
+	private static final Logger log = Red5LoggerFactory.getLogger(DocumentConverter.class, webAppRootKey);
 
 	@Autowired
-	private GenerateThumbs generateThumbs;
-	@Autowired
 	private GenerateSWF generateSWF;
 	@Autowired
 	private ConfigurationDao configurationDao;
+	@Autowired
+	private ImageConverter imageConverter;
 
 	public ConverterProcessResultList convertPDF(FileExplorerItem f, String ext) throws Exception {
 		ConverterProcessResultList errors = new ConverterProcessResultList();
@@ -60,9 +58,9 @@ public class GeneratePDF {
 			log.debug("-- running JOD --");
 			errors.addItem("processOpenOffice", doJodConvert(original, pdf));
 		}
-		
+
 		log.debug("-- generateBatchThumb --");
-		errors.addItem("processThumb", generateThumbs.generateBatchThumb(pdf, pdf.getParentFile(), 80, "thumb"));
+		errors.addItem("processThumb", imageConverter.generateBatchThumb(pdf, pdf.getParentFile(), 80, "thumb"));
 		File swf = f.getFile();
 		errors.addItem("processSWF", generateSWF.generateSwf(pdf, swf));
 

Modified: openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/FlvExplorerConverter.java
URL: http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/FlvExplorerConverter.java?rev=1789036&r1=1789035&r2=1789036&view=diff
==============================================================================
--- openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/FlvExplorerConverter.java (original)
+++ openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/FlvExplorerConverter.java Tue Mar 28 03:19:16 2017
@@ -28,8 +28,6 @@ import java.nio.file.Path;
 import java.nio.file.StandardCopyOption;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
 
 import org.apache.openmeetings.db.dao.file.FileExplorerItemDao;
 import org.apache.openmeetings.db.entity.file.FileExplorerItem;
@@ -42,21 +40,11 @@ import org.springframework.beans.factory
 
 public class FlvExplorerConverter extends BaseConverter {
 	private static final Logger log = Red5LoggerFactory.getLogger(FlvExplorerConverter.class, webAppRootKey);
-	private static final Pattern p = Pattern.compile("\\d{2,4}(x)\\d{2,4}");
 
 	// Spring loaded Beans
 	@Autowired
 	private FileExplorerItemDao fileDao;
 
-	private static class FlvDimension {
-		public FlvDimension(int width, int height) {
-			this.width = width;
-			this.height = height;
-		}
-		public int width = 0;
-		public int height = 0;
-	}
-
 	public List<ConverterProcessResult> convertToMP4(FileExplorerItem f, String ext) {
 		List<ConverterProcessResult> logs = new ArrayList<>();
 		try {
@@ -88,7 +76,7 @@ public class FlvExplorerConverter extend
 				}
 			}
 			//Parse the width height from the FFMPEG output
-			FlvDimension dim = getFlvDimension(res.getError());
+			Dimension dim = getDimension(res.getError());
 			f.setWidth(dim.width);
 			f.setHeight(dim.height);
 			File jpeg = f.getFile(EXTENSION_JPG);
@@ -108,16 +96,4 @@ public class FlvExplorerConverter extend
 
 		return logs;
 	}
-
-	private static FlvDimension getFlvDimension(String txt) throws Exception {
-		Matcher matcher = p.matcher(txt);
-
-		while (matcher.find()) {
-			String foundResolution = txt.substring(matcher.start(), matcher.end());
-			String[] resultions = foundResolution.split("x");
-			return new FlvDimension(Integer.valueOf(resultions[0]).intValue(), Integer.valueOf(resultions[1]).intValue());
-		}
-
-		return new FlvDimension(100, 100); // will return 100x100 for non-video to be able to play
-	}
 }

Copied: openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/ImageConverter.java (from r1789035, openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/GenerateImage.java)
URL: http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/ImageConverter.java?p2=openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/ImageConverter.java&p1=openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/GenerateImage.java&r1=1789035&r2=1789036&rev=1789036&view=diff
==============================================================================
--- openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/GenerateImage.java (original)
+++ openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/ImageConverter.java Tue Mar 28 03:19:16 2017
@@ -41,31 +41,35 @@ import org.red5.logging.Red5LoggerFactor
 import org.slf4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 
-public class GenerateImage extends BaseConverter {
-	private static final Logger log = Red5LoggerFactory.getLogger(GenerateImage.class, webAppRootKey);
+public class ImageConverter extends BaseConverter {
+	private static final Logger log = Red5LoggerFactory.getLogger(ImageConverter.class, webAppRootKey);
 
 	@Autowired
 	private UserDao userDao;
-	@Autowired
-	private GenerateThumbs generateThumbs;
 
 	public ConverterProcessResultList convertImage(FileItem f, String ext) throws IOException {
 		ConverterProcessResultList returnMap = new ConverterProcessResultList();
 
-		File img = f.getFile(ext);
 		File jpg = f.getFile(EXTENSION_JPG);
+		if (!EXTENSION_JPG.equals(ext)) {
+			File img = f.getFile(ext);
 
-		log.debug("##### convertImage destinationFile: " + jpg);
-
-		returnMap.addItem("processJPG", convertSingleJpg(img, jpg));
-		returnMap.addItem("processThumb", generateThumbs.generateThumb(thumbImagePrefix, jpg, 50));
-
+			log.debug("##### convertImage destinationFile: " + jpg);
+			returnMap.addItem("processJPG", convertSingleJpg(img, jpg));
+		}
+		ConverterProcessResult res = ProcessHelper.executeScript("get image dimensions :: " + f.getId()
+				, new String[] {getPathToIdentify(), "-format", "%wx%h", jpg.getCanonicalPath()});
+		returnMap.addItem("get JPG dimensions", res);
+		Dimension dim = getDimension(res.getOut());
+		f.setWidth(dim.width);
+		f.setHeight(dim.height);
+		returnMap.addItem("processThumb", generateThumb(thumbImagePrefix, jpg, 50));
 		return returnMap;
 	}
 
 	public ConverterProcessResultList convertImageUserProfile(File file, Long userId, boolean skipConvertion) throws Exception {
 		ConverterProcessResultList returnMap = new ConverterProcessResultList();
-		
+
 		// User Profile Update
 		File[] files = getUploadProfilesUserDir(userId).listFiles(new FileFilter() {
 			@Override
@@ -78,14 +82,14 @@ public class GenerateImage extends BaseC
 				FileUtils.deleteQuietly(f);
 			}
 		}
-		
+
 		File destinationFile = OmFileHelper.getNewFile(getUploadProfilesUserDir(userId), profileFileName, EXTENSION_JPG);
 		if (!skipConvertion) {
 			returnMap.addItem("processJPG", convertSingleJpg(file, destinationFile));
 		} else {
 			FileUtils.copyFile(file, destinationFile);
 		}
-		returnMap.addItem("processThumb2", generateThumbs.generateThumb(profileImagePrefix, destinationFile, 126));
+		returnMap.addItem("processThumb2", generateThumb(profileImagePrefix, destinationFile, 126));
 
 		if (!skipConvertion) {
 			// Delete old one
@@ -106,20 +110,57 @@ public class GenerateImage extends BaseC
 
 	/**
 	 * -density 150 -resize 800
-	 * @throws IOException 
-	 * 
+	 * @throws IOException
+	 *
 	 */
 	private ConverterProcessResult convertSingleJpg(File in, File out) throws IOException {
-		String[] argv = new String[] { getPathToImageMagick(), in.getCanonicalPath(), out.getCanonicalPath() };
+		String[] argv = new String[] { getPathToConvert(), in.getCanonicalPath(), out.getCanonicalPath() };
 
 		return ProcessHelper.executeScript("convertSingleJpg", argv);
 	}
 
 	public ConverterProcessResult resize(File in, File out, Integer width, Integer height) throws IOException {
-		String[] argv = new String[] { getPathToImageMagick()
+		String[] argv = new String[] { getPathToConvert()
 				, "-resize", (width == null ? "" : width) + (height == null ? "" : "x" + height)
 				, in.getCanonicalPath(), out.getCanonicalPath()
 				};
 		return ProcessHelper.executeScript("GenerateImage::resize", argv);
 	}
+
+	public ConverterProcessResult decodePDF(String inputfile, String outputfile) {
+		log.debug("decodePDF");
+		String[] argv = new String[] { getPathToConvert(), inputfile, outputfile };
+
+		return ProcessHelper.executeScript("generateBatchThumbByWidth", argv);
+	}
+
+	public ConverterProcessResult generateBatchThumb(File in, File outDir, Integer thumbSize, String pre) throws IOException {
+		log.debug("generateBatchThumbByWidth");
+		String[] argv = new String[] {
+			getPathToConvert()
+			, "-thumbnail" // FIXME
+			, "" + thumbSize
+			, in.getCanonicalPath()
+			, new File(outDir, "_" + pre + "_page-%04d.jpg").getCanonicalPath()
+			};
+
+		return ProcessHelper.executeScript("generateBatchThumbByWidth", argv);
+	}
+
+	public ConverterProcessResult generateThumb(String pre, File f, Integer thumbSize) throws IOException {
+		log.debug("generateThumb");
+		// Init variables
+		String name = f.getName();
+		File parent = f.getParentFile();
+
+		String[] argv = new String[] {
+			getPathToConvert()
+			, "-thumbnail"
+			, thumbSize + "x" + thumbSize
+			, f.getCanonicalPath()
+			, new File(parent, pre + name).getCanonicalPath()
+			};
+
+		return ProcessHelper.executeScript("generateBatchThumbByWidth", argv);
+	}
 }

Modified: openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/file/FileProcessor.java
URL: http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/file/FileProcessor.java?rev=1789036&r1=1789035&r2=1789036&view=diff
==============================================================================
--- openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/file/FileProcessor.java (original)
+++ openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/file/FileProcessor.java Tue Mar 28 03:19:16 2017
@@ -28,10 +28,9 @@ import java.util.List;
 import java.util.UUID;
 
 import org.apache.commons.io.FileUtils;
+import org.apache.openmeetings.core.converter.DocumentConverter;
 import org.apache.openmeetings.core.converter.FlvExplorerConverter;
-import org.apache.openmeetings.core.converter.GenerateImage;
-import org.apache.openmeetings.core.converter.GenerateThumbs;
-import org.apache.openmeetings.core.documents.GeneratePDF;
+import org.apache.openmeetings.core.converter.ImageConverter;
 import org.apache.openmeetings.db.dao.file.FileExplorerItemDao;
 import org.apache.openmeetings.db.entity.file.FileExplorerItem;
 import org.apache.openmeetings.db.entity.file.FileItem.Type;
@@ -51,11 +50,9 @@ public class FileProcessor {
 	@Autowired
 	private FileExplorerItemDao fileDao;
 	@Autowired
-	private GenerateImage generateImage;
+	private ImageConverter imageConverter;
 	@Autowired
-	private GenerateThumbs generateThumbs;
-	@Autowired
-	private GeneratePDF generatePDF;
+	private DocumentConverter generatePDF;
 
 	//FIXME TODO this method need to be refactored to throw exceptions
 	public ConverterProcessResultList processFile(FileExplorerItem f, InputStream is) throws Exception {
@@ -116,13 +113,10 @@ public class FileProcessor {
 			returnError = generatePDF.convertPDF(f, ext);
 		} else if (isChart) {
 			log.debug("uploaded chart file");
-		} else if (isImage && !isAsIs) {
+		} else if (isImage) {
 			// convert it to JPG
 			log.debug("##### convert it to JPG: ");
-			returnError = generateImage.convertImage(f, ext);
-		} else if (isAsIs) {
-			ConverterProcessResult processThumb = generateThumbs.generateThumb(thumbImagePrefix, file, 50);
-			returnError.addItem("processThumb", processThumb);
+			returnError = imageConverter.convertImage(f, ext);
 		} else if (isVideo) {
 			List<ConverterProcessResult> returnList = flvExplorerConverter.convertToMP4(f, ext);
 

Modified: openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/util/WebSocketHelper.java
URL: http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/util/WebSocketHelper.java?rev=1789036&r1=1789035&r2=1789036&view=diff
==============================================================================
--- openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/util/WebSocketHelper.java (original)
+++ openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/util/WebSocketHelper.java Tue Mar 28 03:19:16 2017
@@ -24,7 +24,7 @@ import java.io.IOException;
 import java.util.Arrays;
 import java.util.List;
 import java.util.function.BiConsumer;
-import java.util.function.Consumer;
+import java.util.function.BiFunction;
 import java.util.function.Function;
 import java.util.function.Predicate;
 
@@ -55,9 +55,9 @@ public class WebSocketHelper {
 	public static final String ID_ROOM_PREFIX = ID_TAB_PREFIX + "r";
 	public static final String ID_USER_PREFIX = ID_TAB_PREFIX + "u";
 
-	public static void sendClient(final Client c, byte[] b) {
-		if (c != null) {
-			send(a -> Arrays.asList(c), (t) -> {
+	public static void sendClient(final Client _c, byte[] b) {
+		if (_c != null) {
+			send(a -> Arrays.asList(_c), (t, c) -> {
 				try {
 					t.sendMessage(b, 0, b.length);
 				} catch (IOException e) {
@@ -69,11 +69,7 @@ public class WebSocketHelper {
 
 	public static void sendRoom(final RoomMessage m) {
 		log.debug("Sending WebSocket message: {} {}", m.getType(), m instanceof TextRoomMessage ? ((TextRoomMessage)m).getText() : "");
-		sendRoom(m.getRoomId(), (t) -> t.sendMessage(m), null);
-	}
-
-	public static void sendRoom(final Long roomId, final String m) {
-		sendRoom(roomId, m, null);
+		sendRoom(m.getRoomId(), (t, c) -> t.sendMessage(m), null);
 	}
 
 	private static JSONObject setScope(JSONObject o, ChatMessage m, long curUserId) {
@@ -114,16 +110,21 @@ public class WebSocketHelper {
 			.put("msg", arr);
 	}
 
+	public static void sendRoom(final Long roomId, final JSONObject m) {
+		sendRoom(roomId, m, null, null);
+	}
+
 	public static void sendRoom(ChatMessage m, JSONObject msg) {
-		sendRoom(m.getToRoom().getId(), msg.toString()
-				, c -> !m.isNeedModeration() || (m.isNeedModeration() && c.hasRight(Right.moderator)));
+		sendRoom(m.getToRoom().getId(), msg
+				, c -> !m.isNeedModeration() || (m.isNeedModeration() && c.hasRight(Right.moderator))
+				, null);
 	}
 
-	public static void sendRoom(final Long roomId, final String m, Predicate<Client> check) {
+	public static void sendRoom(final Long roomId, final JSONObject m, Predicate<Client> check, BiFunction<JSONObject, Client, String> func) {
 		log.debug("Sending WebSocket message: {}", m);
-		sendRoom(roomId, (t) -> {
+		sendRoom(roomId, (t, c) -> {
 			try {
-				t.sendMessage(m);
+				t.sendMessage(func == null ? m.toString() : func.apply(m, c));
 			} catch (IOException e) {
 				log.error("Error while broadcasting message to room", e);
 			}
@@ -131,7 +132,7 @@ public class WebSocketHelper {
 	}
 
 	public static void sendUser(final Long userId, final String m) {
-		send(a -> ((IApplication)a).getOmClients(userId), (t) -> {
+		send(a -> ((IApplication)a).getOmClients(userId), (t, c) -> {
 			try {
 				t.sendMessage(m);
 			} catch (IOException e) {
@@ -157,13 +158,13 @@ public class WebSocketHelper {
 		}
 	}
 
-	public static void sendRoom(final Long roomId, Consumer<IWebSocketConnection> consumer, Predicate<Client> check) {
+	public static void sendRoom(final Long roomId, BiConsumer<IWebSocketConnection, Client> consumer, Predicate<Client> check) {
 		send(a -> ((IApplication)a).getOmRoomClients(roomId), consumer, check);
 	}
 
 	public static void send(
 			final Function<Application, List<Client>> func
-			, Consumer<IWebSocketConnection> consumer
+			, BiConsumer<IWebSocketConnection, Client> consumer
 			, Predicate<Client> check)
 	{
 		Application app = Application.get(OpenmeetingsVariables.wicketApplicationName);
@@ -174,7 +175,7 @@ public class WebSocketHelper {
 			if (check == null || check.test(c)) {
 				final IWebSocketConnection wc = reg.getConnection(app, c.getSessionId(), new PageIdKey(c.getPageId()));
 				if (wc != null && wc.isOpen()) {
-					executor.run(() -> consumer.accept(wc));
+					executor.run(() -> consumer.accept(wc, c));
 				}
 			}
 		}

Modified: openmeetings/application/branches/3.2.x/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java
URL: http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java?rev=1789036&r1=1789035&r2=1789036&view=diff
==============================================================================
--- openmeetings/application/branches/3.2.x/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java (original)
+++ openmeetings/application/branches/3.2.x/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java Tue Mar 28 03:19:16 2017
@@ -35,6 +35,7 @@ import static org.apache.openmeetings.ut
 import static org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_FRONTEND_REGISTER_KEY;
 import static org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_GOOGLE_ANALYTICS_CODE;
 import static org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_IGNORE_BAD_SSL;
+import static org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_IMAGEMAGIC_PATH;
 import static org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_LOGIN_MIN_LENGTH_KEY;
 import static org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_MAX_UPLOAD_SIZE_KEY;
 import static org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_OAUTH_REGISTER_KEY;
@@ -243,7 +244,7 @@ public class ImportInitvalues {
 
 		cfgDao.add("swftools_path", cfg.swfPath, null, "Path To SWF-Tools");
 
-		cfgDao.add("imagemagick_path", cfg.imageMagicPath, null, "Path to ImageMagick tools");
+		cfgDao.add(CONFIG_IMAGEMAGIC_PATH, cfg.imageMagicPath, null, "Path to ImageMagick tools");
 
 		cfgDao.add("sox_path", cfg.soxPath, null, "Path To SoX-Tools");
 

Modified: openmeetings/application/branches/3.2.x/openmeetings-util/src/main/java/org/apache/openmeetings/util/OpenmeetingsVariables.java
URL: http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-util/src/main/java/org/apache/openmeetings/util/OpenmeetingsVariables.java?rev=1789036&r1=1789035&r2=1789036&view=diff
==============================================================================
--- openmeetings/application/branches/3.2.x/openmeetings-util/src/main/java/org/apache/openmeetings/util/OpenmeetingsVariables.java (original)
+++ openmeetings/application/branches/3.2.x/openmeetings-util/src/main/java/org/apache/openmeetings/util/OpenmeetingsVariables.java Tue Mar 28 03:19:16 2017
@@ -48,6 +48,7 @@ public class OpenmeetingsVariables {
 	public static final String CONFIG_DEFAULT_GROUP_ID = "default_group_id";
 	public static final String CONFIG_GOOGLE_ANALYTICS_CODE = "google.analytics.code";
 	public static final String CONFIG_SYSTEM_EMAIL = "system_email_addr";
+	public static final String CONFIG_IMAGEMAGIC_PATH = "imagemagick_path";
 	public static final String MENU_ROOMS_NAME = "Conference Rooms";
 	public static final int RECENT_ROOMS_COUNT = 5;
 	public static final int LEVEL_USER = 1;

Modified: openmeetings/application/branches/3.2.x/openmeetings-util/src/main/java/org/apache/openmeetings/util/process/ProcessHelper.java
URL: http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-util/src/main/java/org/apache/openmeetings/util/process/ProcessHelper.java?rev=1789036&r1=1789035&r2=1789036&view=diff
==============================================================================
--- openmeetings/application/branches/3.2.x/openmeetings-util/src/main/java/org/apache/openmeetings/util/process/ProcessHelper.java (original)
+++ openmeetings/application/branches/3.2.x/openmeetings-util/src/main/java/org/apache/openmeetings/util/process/ProcessHelper.java Tue Mar 28 03:19:16 2017
@@ -20,14 +20,11 @@ package org.apache.openmeetings.util.pro
 
 import static java.nio.charset.StandardCharsets.UTF_8;
 
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.concurrent.TimeoutException;
+import java.util.concurrent.TimeUnit;
 
+import org.apache.commons.io.IOUtils;
 import org.apache.openmeetings.util.OpenmeetingsVariables;
 import org.red5.logging.Red5LoggerFactory;
 import org.slf4j.Logger;
@@ -35,49 +32,6 @@ import org.slf4j.Logger;
 public class ProcessHelper {
 	public static final Logger log = Red5LoggerFactory.getLogger(ProcessHelper.class, OpenmeetingsVariables.webAppRootKey);
 
-	private static class Worker extends Thread {
-		private final Process process;
-		private Integer exitCode;
-
-		private Worker(Process process) {
-			this.process = process;
-		}
-
-		@Override
-		public void run() {
-			try {
-				exitCode = process.waitFor();
-			} catch (InterruptedException ignore) {
-				return;
-			}
-		}
-	}
-
-	private static class StreamWatcher extends Thread {
-		public StringBuilder output;
-		private final InputStream is;
-		private final BufferedReader br;
-
-		private StreamWatcher(Process process, boolean isError) {
-			output = new StringBuilder();
-			is = isError ? process.getErrorStream() : process.getInputStream();
-			br = new BufferedReader(new InputStreamReader(is, UTF_8));
-		}
-
-		@Override
-		public void run() {
-			try {
-				String line = br.readLine();
-				while (line != null) {
-					output.append(line).append('\n');
-					line = br.readLine();
-				}
-			} catch (IOException ioexception) {
-				return;
-			}
-		}
-	}
-
 	public static ConverterProcessResult executeScriptWindows(String process, String[] argv) {
 		try {
 			String[] cmd = new String[argv.length + 2];
@@ -119,13 +73,14 @@ public class ProcessHelper {
 	}
 
 	public static ConverterProcessResult executeScript(String process, String[] argv, Map<? extends String, ? extends String> env) {
-		ConverterProcessResult returnMap = new ConverterProcessResult();
-		returnMap.setProcess(process);
+		ConverterProcessResult res = new ConverterProcessResult();
+		res.setProcess(process);
 		debugCommandStart(process, argv);
 
+		Process proc = null;
 		try {
-			returnMap.setCommand(getCommand(argv));
-			returnMap.setOut("");
+			res.setCommand(getCommand(argv));
+			res.setOut("");
 
 			// By using the process Builder we have access to modify the
 			// environment variables
@@ -133,56 +88,29 @@ public class ProcessHelper {
 			ProcessBuilder pb = new ProcessBuilder(argv);
 			pb.environment().putAll(env);
 
-			Process proc = pb.start();
+			proc = pb.start();
 
 			// 20-minute timeout for command execution
 			// FFMPEG conversion of Recordings may take a real long time until
 			// its finished
-			long timeout = 60000 * 20;
-
-			StreamWatcher errorWatcher = new StreamWatcher(proc, true);
-			Worker worker = new Worker(proc);
-			StreamWatcher inputWatcher = new StreamWatcher(proc, false);
-			errorWatcher.start();
-			inputWatcher.start();
-			worker.start();
-
-			try {
-				worker.join(timeout);
-				if (worker.exitCode != null) {
-					returnMap.setExitCode(worker.exitCode);
-					log.debug("exitVal: " + worker.exitCode);
-					returnMap.setError(errorWatcher.output.toString());
-				} else {
-					returnMap.setException("timeOut");
-					returnMap.setError(errorWatcher.output.toString());
-					returnMap.setExitCode(-1);
-
-					throw new TimeoutException();
-				}
-			} catch (InterruptedException ex) {
-				worker.interrupt();
-				errorWatcher.interrupt();
-				inputWatcher.interrupt();
-				Thread.currentThread().interrupt();
-
-				returnMap.setError(ex.getMessage());
-				returnMap.setExitCode(-1);
-
-				throw ex;
-			} finally {
-				proc.destroy();
-			}
+			proc.waitFor(20, TimeUnit.MINUTES);
 
+			res.setExitCode(proc.exitValue());
+			res.setOut(IOUtils.toString(proc.getInputStream(), UTF_8));
+			res.setError(IOUtils.toString(proc.getErrorStream(), UTF_8));
 		} catch (Throwable t) {
 			log.error("executeScript", t);
-			returnMap.setError(t.getMessage());
-			returnMap.setException(t.toString());
-			returnMap.setExitCode(-1);
+			res.setError(t.getMessage());
+			res.setException(t.toString());
+			res.setExitCode(-1);
+		} finally {
+			if (proc != null) {
+				proc.destroy();
+			}
 		}
 
 		debugCommandEnd(process);
-		return returnMap;
+		return res;
 	}
-
 }
+

Modified: openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/admin/groups/GroupForm.java
URL: http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/admin/groups/GroupForm.java?rev=1789036&r1=1789035&r2=1789036&view=diff
==============================================================================
--- openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/admin/groups/GroupForm.java (original)
+++ openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/admin/groups/GroupForm.java Tue Mar 28 03:19:16 2017
@@ -27,7 +27,7 @@ import static org.apache.openmeetings.we
 
 import java.io.File;
 
-import org.apache.openmeetings.core.converter.GenerateImage;
+import org.apache.openmeetings.core.converter.ImageConverter;
 import org.apache.openmeetings.db.dao.user.GroupDao;
 import org.apache.openmeetings.db.dao.user.GroupUserDao;
 import org.apache.openmeetings.db.entity.user.Group;
@@ -71,7 +71,7 @@ public class GroupForm extends AdminBase
 
 		@Override
 		protected void processImage(StoredFile sf, File f) throws Exception {
-			getBean(GenerateImage.class).resize(f, getGroupLogo(GroupForm.this.getModelObject().getId(), false), null, 28);
+			getBean(ImageConverter.class).resize(f, getGroupLogo(GroupForm.this.getModelObject().getId(), false), null, 28);
 		}
 
 		@Override

Modified: openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/UploadableProfileImagePanel.java
URL: http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/UploadableProfileImagePanel.java?rev=1789036&r1=1789035&r2=1789036&view=diff
==============================================================================
--- openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/UploadableProfileImagePanel.java (original)
+++ openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/UploadableProfileImagePanel.java Tue Mar 28 03:19:16 2017
@@ -23,7 +23,7 @@ import static org.apache.openmeetings.we
 
 import java.io.File;
 
-import org.apache.openmeetings.core.converter.GenerateImage;
+import org.apache.openmeetings.core.converter.ImageConverter;
 import org.apache.openmeetings.util.StoredFile;
 
 public class UploadableProfileImagePanel extends UploadableImagePanel {
@@ -37,7 +37,7 @@ public class UploadableProfileImagePanel
 
 	@Override
 	protected void processImage(StoredFile sf, File f) throws Exception {
-		getBean(GenerateImage.class).convertImageUserProfile(f, userId, sf.isAsIs());
+		getBean(ImageConverter.class).convertImageUserProfile(f, userId, sf.isAsIs());
 	}
 
 	@Override

Modified: openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.html
URL: http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.html?rev=1789036&r1=1789035&r2=1789036&view=diff
==============================================================================
--- openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.html (original)
+++ openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.html Tue Mar 28 03:19:16 2017
@@ -26,7 +26,7 @@
 			<div class="room sidebar left" wicket:id="sidebar"></div>
 			<div wicket:id="wb-area" class="room wb area">
 				<div class="wb-drop-area"></div>
-				<div class="wb" wicket:id="whiteboard"></div>
+				<div class="wb-area" wicket:id="whiteboard"></div>
 			</div>
 			<div wicket:id="activities"></div>
 		</div>

Modified: openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomResourceReference.java
URL: http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomResourceReference.java?rev=1789036&r1=1789035&r2=1789036&view=diff
==============================================================================
--- openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomResourceReference.java (original)
+++ openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomResourceReference.java Tue Mar 28 03:19:16 2017
@@ -112,7 +112,7 @@ public class RoomResourceReference exten
 
 	protected File getFile(FileExplorerItem f, String ext) {
 		File file = f.getFile(ext);
-		if (!file.exists()) {
+		if (file == null || !file.exists()) {
 			file = new File(new File(getOmHome(), "default"), String.format("deleted.%s"
 					, FileItem.Type.Image == f.getType() ? EXTENSION_JPG : EXTENSION_SWF));
 		}

Modified: openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/room.js
URL: http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/room.js?rev=1789036&r1=1789035&r2=1789036&view=diff
==============================================================================
--- openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/room.js (original)
+++ openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/room.js Tue Mar 28 03:19:16 2017
@@ -17,17 +17,19 @@
  * under the License.
  */
 function setRoomSizes() {
-	var w = $(window).width() - $(".room.sidebar.left").width() - 5;
-	$(".room.wb.area").width(w);
-	$(".room.wb.area .wb").width(w);
+	var sb = $(".room.sidebar.left")
+		, w = $(window).width() - sb.width() - 5
+		, h = $(window).height() - $('#menu').height()
+		, p = sb.find('.tabs');
+	sb.height(h);
+	var hh = h - 5;
+	p.height(hh);
+	$(".user.list", p).height(hh - $("ul", p).height() - $(".user.header", p).height() - 5);
 
-	var h = $(window).height() - $('#menu').height();
-	$(".room.sidebar.left").height(h);
-	var p = $(".room.sidebar.left .tabs");
-	p.height(h - 5);
-	$(".user.list", p).height(h - $("ul", p).height() - $(".user.header", p).height() - 10);
-	$(".room.wb.area").height(h);
-	$(".room.wb.area .wb").height(h);
+	var container = $(".room.wb.area")
+		, area = container.find(".wb-area");
+	container.width(w).height(h).css('left', sb.width() + "px");
+	area.width(w).height(hh);
 }
 function roomReload(event, ui) {
 	window.location.reload();
@@ -61,7 +63,7 @@ function roomLoad() {
 	$(".room.sidebar.left").resizable({
 		handles: "e"
 		, stop: function(event, ui) {
-			alignBlocks();
+			setRoomSizes();
 		}
 	});
 	Wicket.Event.subscribe("/websocket/closed", roomClosed);

Modified: openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/chat/Chat.java
URL: http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/chat/Chat.java?rev=1789036&r1=1789035&r2=1789036&view=diff
==============================================================================
--- openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/chat/Chat.java (original)
+++ openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/chat/Chat.java Tue Mar 28 03:19:16 2017
@@ -102,8 +102,7 @@ public class Chat extends Panel {
 					WebSocketHelper.sendRoom(roomId
 							, new JSONObject().put("type", "typing")
 									.put("active", type.indexOf("start") > -1)
-									.put("uid", getUid())
-									.toString());
+									.put("uid", getUid()));
 				}
 			} catch (Exception e) {
 				log.error("Unexpected exception while accepting chat message", e);

Modified: openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/WEB-INF/classes/openmeetings-applicationContext.xml
URL: http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/WEB-INF/classes/openmeetings-applicationContext.xml?rev=1789036&r1=1789035&r2=1789036&view=diff
==============================================================================
--- openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/WEB-INF/classes/openmeetings-applicationContext.xml (original)
+++ openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/WEB-INF/classes/openmeetings-applicationContext.xml Tue Mar 28 03:19:16 2017
@@ -7,16 +7,16 @@
   to you under the Apache License, Version 2.0 (the
   "License"); you may not use this file except in compliance
   with the License.  You may obtain a copy of the License at
-  
+
       http://www.apache.org/licenses/LICENSE-2.0
-  
+
   Unless required by applicable law or agreed to in writing,
   software distributed under the License is distributed on an
   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   KIND, either express or implied.  See the License for the
   specific language governing permissions and limitations
   under the License.
-  
+
 -->
 <beans xmlns="http://www.springframework.org/schema/beans"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -203,9 +203,8 @@
 	<bean id="omCalendarDao" class="org.apache.openmeetings.db.dao.calendar.OmCalendarDao" />
 
 	<!-- No Interface -->
-	<bean id="generateImage" class="org.apache.openmeetings.core.converter.GenerateImage" />
-	<bean id="generateThumbs" class="org.apache.openmeetings.core.converter.GenerateThumbs" />
-	<bean id="generatePDF" class="org.apache.openmeetings.core.documents.GeneratePDF" />
+	<bean id="imageConverter" class="org.apache.openmeetings.core.converter.ImageConverter" />
+	<bean id="documentConverter" class="org.apache.openmeetings.core.converter.DocumentConverter" />
 	<bean id="smsHandler" class="org.apache.openmeetings.core.mail.SMSHandler" />
 	<bean id="importInitvalues" class="org.apache.openmeetings.installation.ImportInitvalues" />
 	<bean id="generateSWF" class="org.apache.openmeetings.core.converter.GenerateSWF" />

Modified: openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/forms.css
URL: http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/forms.css?rev=1789036&r1=1789035&r2=1789036&view=diff
==============================================================================
--- openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/forms.css (original)
+++ openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/forms.css Tue Mar 28 03:19:16 2017
@@ -32,7 +32,7 @@ div.formSaveBar {
 	vertical-align: super;
 }
 div.formSaveButton input {
-	background: url(images/forms/disk.png) no-repeat;
+	background: url(images/disk.png) no-repeat;
 	float: left;
 	cursor: pointer;
 	width: 18px;
@@ -42,13 +42,13 @@ div.formSaveButton input {
 	margin-top: 2px;
 }
 .addButton {
-	background: url(images/forms/plus_icon.png) no-repeat;
+	background: url(images/plus_icon.png) no-repeat;
 }
 .delButton {
-	background: url(images/forms/cancel_icon.png) no-repeat;
+	background: url(images/cancel_icon.png) no-repeat;
 }
 .formNewButton {
-	background: url(images/forms/plus_icon.png) no-repeat;
+	background: url(images/plus_icon.png) no-repeat;
 	float: left;
 	cursor: pointer;
 	width: 18px;
@@ -58,10 +58,10 @@ div.formSaveButton input {
 	margin-top: 2px;
 }
 .formNewButton.disabled {
-	background: url(images/forms/plus_icon_disabled.png) no-repeat;
+	background: url(images/plus_icon_disabled.png) no-repeat;
 }
 div.formRefreshButton input {
-	background: url(images/forms/arrow_refresh_small.png) no-repeat;
+	background: url(images/arrow_refresh_small.png) no-repeat;
 	float: left;
 	cursor: pointer;
 	width: 18px;
@@ -71,7 +71,7 @@ div.formRefreshButton input {
 	margin-top: 2px;
 }
 .formCancelButton {
-	background: url(images/forms/cancel_icon.png) no-repeat;
+	background: url(images/cancel_icon.png) no-repeat;
 	display: inline-block;
 	float: left;
 	cursor: pointer;

Added: openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/arrow.png
URL: http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/arrow.png?rev=1789036&view=auto
==============================================================================
Binary file - no diff available.

Propchange: openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/arrow.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/disk.png
URL: http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/disk.png?rev=1789036&view=auto
==============================================================================
Binary file - no diff available.

Propchange: openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/disk.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/ellipse.png
URL: http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/ellipse.png?rev=1789036&view=auto
==============================================================================
Binary file - no diff available.

Propchange: openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/ellipse.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/font.png
URL: http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/font.png?rev=1789036&view=auto
==============================================================================
Binary file - no diff available.

Propchange: openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/font.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/line.png
URL: http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/line.png?rev=1789036&view=auto
==============================================================================
Binary file - no diff available.

Propchange: openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/line.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/next.png
URL: http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/next.png?rev=1789036&view=auto
==============================================================================
Binary file - no diff available.

Propchange: openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/next.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/paintbrush.png
URL: http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/paintbrush.png?rev=1789036&view=auto
==============================================================================
Binary file - no diff available.

Propchange: openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/paintbrush.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/plus_icon.png
URL: http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/plus_icon.png?rev=1789036&view=auto
==============================================================================
Binary file - no diff available.

Propchange: openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/plus_icon.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/plus_icon_disabled.png
URL: http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/plus_icon_disabled.png?rev=1789036&view=auto
==============================================================================
Binary file - no diff available.

Propchange: openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/plus_icon_disabled.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/pointer.png
URL: http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/pointer.png?rev=1789036&view=auto
==============================================================================
Binary file - no diff available.

Propchange: openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/pointer.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/prev.png
URL: http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/prev.png?rev=1789036&view=auto
==============================================================================
Binary file - no diff available.

Propchange: openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/prev.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/rectangle.png
URL: http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/rectangle.png?rev=1789036&view=auto
==============================================================================
Binary file - no diff available.

Propchange: openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/rectangle.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/uline.png
URL: http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/uline.png?rev=1789036&view=auto
==============================================================================
Binary file - no diff available.

Propchange: openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/uline.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/wbpointer.png
URL: http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/wbpointer.png?rev=1789036&view=auto
==============================================================================
Binary file - no diff available.

Propchange: openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/images/wbpointer.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/room.css
URL: http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/room.css?rev=1789036&r1=1789035&r2=1789036&view=diff
==============================================================================
--- openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/room.css (original)
+++ openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/room.css Tue Mar 28 03:19:16 2017
@@ -88,15 +88,15 @@
 .room.sidebar.left {
 	min-width: 200px;
 	width: 315px;
-	float: left;
+	position: absolute;
 }
 .room.wb.area {
-	float: left;
+	position: absolute;
 }
 .room.wb.area.ui-state-hover {
 	border: 0;
 }
-.room.wb.area.ui-state-hover .wb {
+.room.wb.area.ui-state-hover .wb-area {
 	visibility: hidden;
 	height: 1px !important;
 }
@@ -110,6 +110,79 @@
 	height: inherit;
 	background-position: center;
 }
+.room.wb.area .tabs.ui-tabs, .room.wb.area .ui-tabs-panel {
+	padding: 0;
+	background-color:transparent;
+}
+.room.wb.area .ui-tabs-panel {
+	position: relative;
+}
+.room.wb.area .tools {
+	position: relative;
+	display: inline-block;
+	border: 0;
+}
+.room.wb.area .tools .bumper {
+	float: left;
+	display: inline-block;
+	background: repeating-linear-gradient(-45deg, transparent, transparent 3px, gray 3px, gray 5px);
+}
+.room.wb.area .tools.vertical .bumper {
+	width: 38px;
+	height: 20px;
+}
+.room.wb.area .tools.horisontal .bumper {
+	width: 20px;
+	height: 38px;
+}
+.room.wb.area .tools.vertical {
+	width: 38px;
+	height: 420px;
+}
+.room.wb.area .tools.horisontal {
+	width: 420px;
+	height: 38px;
+}
+.room.wb.area .tools .om-icon.big {
+	float: left;
+	vertical-align: top;
+}
+.room.wb.area .tools .om-icon.big.active {
+	background-color: whitesmoke;
+}
+.room.wb.area .tools .om-icon.big.paint {
+	background-image: url(images/paintbrush.png);
+}
+.room.wb.area .tools .om-icon.big.pointer {
+	background-image: url(images/pointer.png);
+}
+.room.wb.area .tools .om-icon.big.apointer {
+	background-image: url(images/wbpointer.png);
+}
+.room.wb.area .tools .om-icon.big.line {
+	background-image: url(images/line.png);
+}
+.room.wb.area .tools .om-icon.big.uline {
+	background-image: url(images/uline.png);
+}
+.room.wb.area .tools .om-icon.big.rect {
+	background-image: url(images/rectangle.png);
+}
+.room.wb.area .tools .om-icon.big.ellipse {
+	background-image: url(images/ellipse.png);
+}
+.room.wb.area .tools .om-icon.big.text {
+	background-image: url(images/font.png);
+}
+.room.wb.area .tools .om-icon.big.arrow {
+	background-image: url(images/arrow.png);
+}
+.room.wb.area .om-icon.big.next {
+	background-image: url(images/next.png);
+}
+.room.wb.area .om-icon.big.prev {
+	background-image: url(images/prev.png);
+}
 .room.sidebar.left .ui-tabs .ui-tabs-panel {
 	padding: 0;
 }
@@ -228,7 +301,7 @@
 .restart.ui-icon {
 	background-image: url(images/arrow_refresh_small.png);
 }
-.settings.ui-icon {
+.settings.ui-icon, .settings.om-icon {
 	background-image: url(images/settings.png);
 }
 .activity.cam.ui-icon {
@@ -296,3 +369,102 @@
 .room.sidebar.left .tab.om-icon.big.file {
 	background-image: url(images/folder_explore.png);
 }
+/**************************/
+.wb-settings {
+	position: absolute;
+}
+.wb-settings, .wb-settings .tab.props {
+	display: inline-block;
+	width: 310px;
+}
+.wb-settings .ui-dialog-titlebar-close {
+	position: absolute;
+	right: .3em;
+	top: 5px;
+	width: 20px;
+	padding: 1px;
+	height: 20px;
+}
+.wb-settings .header {
+	padding: 5px;
+}
+.wb-settings .header .ui-dialog-title {
+	padding-left: 10px;
+}
+.wb-settings .tab.props {
+	padding: 5px 10px;
+}
+.wb-settings .tab.props .prop-row {
+	padding-top: 5px;
+	margin: 0;
+	font-size: small;
+}
+.wb-settings .tab.props .block {
+	display: inline;
+	padding-left: 5px;
+}
+.wb-settings .tab.props .block.lbl {
+	width: 1em;
+}
+.wb-settings .tab.props .block.but {
+	width: 2.5em;
+}
+.wb-settings .tab.props .block.input {
+	width: 40px;
+}
+.wb-settings .tab.props .block.input input {
+	width: 30px;
+}
+.wb-settings .tab.props .block.input input[type=number] {
+	width: 40px;
+}
+.wb-settings .tab.props .block.input input[type=color] {
+	padding: 0;
+}
+.wb-settings .tab.props .block.input input[type=color]:disabled {
+	opacity:.3;
+}
+.wb-settings .tab.props .block.but button {
+	width: 2.5em;
+}
+.wb-settings .tab.props  .wb-prop-i.selected {
+	font-style: italic;
+}
+.wb-settings .tab.props .wb-prop-b.selected {
+	font-weight: bold;
+}
+.dropdown-menu.om-left {
+	right: 0;
+	left: auto !important;
+}
+.wb-tabbar {
+	padding-left: 70px !important;
+	padding-right: 35px !important;
+}
+.wb-tabbar .scroll-container {
+	overflow: hidden;
+}
+.wb-tabbar .scroll-container .scrollable, .wb-tabbar .scroll-container .scrollable li {
+	display: flex;
+}
+.wb-tabbar .add.disabled, .wb-tabbar .prev.disabled, .wb-tabbar .next.disabled {
+	opacity: .3;
+}
+.wb-tabbar .add, .wb-tabbar .prev, .wb-tabbar .next {
+	position: absolute;
+	top: 3px;
+}
+.wb-tabbar .add {
+	left: 2px;
+}
+.wb-tabbar .prev {
+	left: 35px;
+}
+.wb-tabbar .next {
+	right: 2px;
+}
+.wb-tabbar li button {
+	width: 20px;
+	height: 20px;
+	padding: 0;
+}

Modified: openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/theme.css
URL: http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/theme.css?rev=1789036&r1=1789035&r2=1789036&view=diff
==============================================================================
--- openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/theme.css (original)
+++ openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/css/theme.css Tue Mar 28 03:19:16 2017
@@ -298,6 +298,7 @@ html, body {
 }
 .om-icon.big {
 	background-size: 32px;
+	background-position: 1px 1px !important;
 	width: 34px;
 	height: 34px;
 }

Modified: openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/BaseConverter.java
URL: http://svn.apache.org/viewvc/openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/BaseConverter.java?rev=1789036&r1=1789035&r2=1789036&view=diff
==============================================================================
--- openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/BaseConverter.java (original)
+++ openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/BaseConverter.java Tue Mar 28 03:19:16 2017
@@ -23,6 +23,7 @@ import static org.apache.openmeetings.ut
 import static org.apache.openmeetings.util.OmFileHelper.EXTENSION_JPG;
 import static org.apache.openmeetings.util.OmFileHelper.getRecordingMetaData;
 import static org.apache.openmeetings.util.OmFileHelper.getStreamsSubDir;
+import static org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_IMAGEMAGIC_PATH;
 import static org.apache.openmeetings.util.OpenmeetingsVariables.webAppRootKey;
 
 import java.io.File;
@@ -32,7 +33,10 @@ import java.util.Arrays;
 import java.util.Date;
 import java.util.List;
 import java.util.concurrent.TimeUnit;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
+import org.apache.directory.api.util.Strings;
 import org.apache.openmeetings.db.dao.basic.ConfigurationDao;
 import org.apache.openmeetings.db.dao.record.RecordingMetaDataDao;
 import org.apache.openmeetings.db.dao.record.RecordingMetaDeltaDao;
@@ -50,6 +54,7 @@ import org.springframework.beans.factory
 
 public abstract class BaseConverter {
 	private static final Logger log = Red5LoggerFactory.getLogger(BaseConverter.class, webAppRootKey);
+	private static final Pattern p = Pattern.compile("\\d{2,5}(x)\\d{2,5}");
 
 	@Autowired
 	private ConfigurationDao configurationDao;
@@ -58,9 +63,19 @@ public abstract class BaseConverter {
 	@Autowired
 	private RecordingMetaDeltaDao metaDeltaDao;
 
+	protected static class Dimension {
+		public int width = 0;
+		public int height = 0;
+
+		public Dimension(int width, int height) {
+			this.width = width;
+			this.height = height;
+		}
+	}
+
 	private String getPath(String key, String app) {
 		String path = configurationDao.getConfValue(key, String.class, "");
-		if (!"".equals(path) && !path.endsWith(File.separator)) {
+		if (!Strings.isEmpty(path) && !path.endsWith(File.separator)) {
 			path += File.separator;
 		}
 		path += app;
@@ -75,12 +90,12 @@ public abstract class BaseConverter {
 		return getPath("sox_path", "sox");
 	}
 
-	protected String getPathToImageMagick() {
-		return getPath("imagemagick_path", "convert") + GenerateSWF.execExt;
+	protected String getPathToConvert() {
+		return getPath(CONFIG_IMAGEMAGIC_PATH, "convert") + GenerateSWF.execExt;
 	}
 
-	protected boolean isUseOldStyleFfmpegMap() {
-		return "1".equals(configurationDao.getConfValue("use.old.style.ffmpeg.map.option", String.class, "0"));
+	protected String getPathToIdentify() {
+		return getPath(CONFIG_IMAGEMAGIC_PATH, "identify") + GenerateSWF.execExt;
 	}
 
 	protected File getStreamFolder(Recording recording) {
@@ -380,4 +395,16 @@ public abstract class BaseConverter {
 
 		returnLog.add(ProcessHelper.executeScript("generate preview JPG", argv));
 	}
+
+	protected static Dimension getDimension(String txt) {
+		Matcher matcher = p.matcher(txt);
+
+		while (matcher.find()) {
+			String foundResolution = txt.substring(matcher.start(), matcher.end());
+			String[] resultions = foundResolution.split("x");
+			return new Dimension(Integer.valueOf(resultions[0]).intValue(), Integer.valueOf(resultions[1]).intValue());
+		}
+
+		return new Dimension(100, 100); // will return 100x100 for non-video to be able to play
+	}
 }

Copied: openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/DocumentConverter.java (from r1789035, openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/GeneratePDF.java)
URL: http://svn.apache.org/viewvc/openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/DocumentConverter.java?p2=openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/DocumentConverter.java&p1=openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/GeneratePDF.java&r1=1789035&r2=1789036&rev=1789036&view=diff
==============================================================================
--- openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/GeneratePDF.java (original)
+++ openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/DocumentConverter.java Tue Mar 28 03:19:16 2017
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.openmeetings.core.documents;
+package org.apache.openmeetings.core.converter;
 
 import static org.apache.openmeetings.core.documents.CreateLibraryPresentation.generateXMLDocument;
 import static org.apache.openmeetings.util.OmFileHelper.EXTENSION_PDF;
@@ -24,8 +24,6 @@ import static org.apache.openmeetings.ut
 
 import java.io.File;
 
-import org.apache.openmeetings.core.converter.GenerateSWF;
-import org.apache.openmeetings.core.converter.GenerateThumbs;
 import org.apache.openmeetings.db.dao.basic.ConfigurationDao;
 import org.apache.openmeetings.db.entity.file.FileExplorerItem;
 import org.apache.openmeetings.util.process.ConverterProcessResult;
@@ -39,15 +37,15 @@ import org.red5.logging.Red5LoggerFactor
 import org.slf4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 
-public class GeneratePDF {
-	private static final Logger log = Red5LoggerFactory.getLogger(GeneratePDF.class, webAppRootKey);
+public class DocumentConverter {
+	private static final Logger log = Red5LoggerFactory.getLogger(DocumentConverter.class, webAppRootKey);
 
 	@Autowired
-	private GenerateThumbs generateThumbs;
-	@Autowired
 	private GenerateSWF generateSWF;
 	@Autowired
 	private ConfigurationDao configurationDao;
+	@Autowired
+	private ImageConverter imageConverter;
 
 	public ConverterProcessResultList convertPDF(FileExplorerItem f, String ext) throws Exception {
 		ConverterProcessResultList errors = new ConverterProcessResultList();
@@ -60,9 +58,9 @@ public class GeneratePDF {
 			log.debug("-- running JOD --");
 			errors.addItem("processOpenOffice", doJodConvert(original, pdf));
 		}
-		
+
 		log.debug("-- generateBatchThumb --");
-		errors.addItem("processThumb", generateThumbs.generateBatchThumb(pdf, pdf.getParentFile(), 80, "thumb"));
+		errors.addItem("processThumb", imageConverter.generateBatchThumb(pdf, pdf.getParentFile(), 80, "thumb"));
 		File swf = f.getFile();
 		errors.addItem("processSWF", generateSWF.generateSwf(pdf, swf));
 

Modified: openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/FlvExplorerConverter.java
URL: http://svn.apache.org/viewvc/openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/FlvExplorerConverter.java?rev=1789036&r1=1789035&r2=1789036&view=diff
==============================================================================
--- openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/FlvExplorerConverter.java (original)
+++ openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/FlvExplorerConverter.java Tue Mar 28 03:19:16 2017
@@ -28,8 +28,6 @@ import java.nio.file.Path;
 import java.nio.file.StandardCopyOption;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
 
 import org.apache.openmeetings.db.dao.file.FileExplorerItemDao;
 import org.apache.openmeetings.db.entity.file.FileExplorerItem;
@@ -42,21 +40,11 @@ import org.springframework.beans.factory
 
 public class FlvExplorerConverter extends BaseConverter {
 	private static final Logger log = Red5LoggerFactory.getLogger(FlvExplorerConverter.class, webAppRootKey);
-	private static final Pattern p = Pattern.compile("\\d{2,4}(x)\\d{2,4}");
 
 	// Spring loaded Beans
 	@Autowired
 	private FileExplorerItemDao fileDao;
 
-	private static class FlvDimension {
-		public FlvDimension(int width, int height) {
-			this.width = width;
-			this.height = height;
-		}
-		public int width = 0;
-		public int height = 0;
-	}
-
 	public List<ConverterProcessResult> convertToMP4(FileExplorerItem f, String ext) {
 		List<ConverterProcessResult> logs = new ArrayList<>();
 		try {
@@ -88,7 +76,7 @@ public class FlvExplorerConverter extend
 				}
 			}
 			//Parse the width height from the FFMPEG output
-			FlvDimension dim = getFlvDimension(res.getError());
+			Dimension dim = getDimension(res.getError());
 			f.setWidth(dim.width);
 			f.setHeight(dim.height);
 			File jpeg = f.getFile(EXTENSION_JPG);
@@ -108,16 +96,4 @@ public class FlvExplorerConverter extend
 
 		return logs;
 	}
-
-	private static FlvDimension getFlvDimension(String txt) throws Exception {
-		Matcher matcher = p.matcher(txt);
-
-		while (matcher.find()) {
-			String foundResolution = txt.substring(matcher.start(), matcher.end());
-			String[] resultions = foundResolution.split("x");
-			return new FlvDimension(Integer.valueOf(resultions[0]).intValue(), Integer.valueOf(resultions[1]).intValue());
-		}
-
-		return new FlvDimension(100, 100); // will return 100x100 for non-video to be able to play
-	}
 }

Copied: openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/ImageConverter.java (from r1789035, openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/GenerateImage.java)
URL: http://svn.apache.org/viewvc/openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/ImageConverter.java?p2=openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/ImageConverter.java&p1=openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/GenerateImage.java&r1=1789035&r2=1789036&rev=1789036&view=diff
==============================================================================
--- openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/GenerateImage.java (original)
+++ openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/ImageConverter.java Tue Mar 28 03:19:16 2017
@@ -21,8 +21,6 @@ package org.apache.openmeetings.core.con
 import static org.apache.openmeetings.util.OmFileHelper.EXTENSION_JPG;
 import static org.apache.openmeetings.util.OmFileHelper.getUploadProfilesUserDir;
 import static org.apache.openmeetings.util.OmFileHelper.profileFileName;
-import static org.apache.openmeetings.util.OmFileHelper.profileImagePrefix;
-import static org.apache.openmeetings.util.OmFileHelper.thumbImagePrefix;
 import static org.apache.openmeetings.util.OpenmeetingsVariables.webAppRootKey;
 
 import java.io.File;
@@ -41,31 +39,34 @@ import org.red5.logging.Red5LoggerFactor
 import org.slf4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 
-public class GenerateImage extends BaseConverter {
-	private static final Logger log = Red5LoggerFactory.getLogger(GenerateImage.class, webAppRootKey);
+public class ImageConverter extends BaseConverter {
+	private static final Logger log = Red5LoggerFactory.getLogger(ImageConverter.class, webAppRootKey);
 
 	@Autowired
 	private UserDao userDao;
-	@Autowired
-	private GenerateThumbs generateThumbs;
 
 	public ConverterProcessResultList convertImage(FileItem f, String ext) throws IOException {
 		ConverterProcessResultList returnMap = new ConverterProcessResultList();
 
-		File img = f.getFile(ext);
 		File jpg = f.getFile(EXTENSION_JPG);
+		if (!EXTENSION_JPG.equals(ext)) {
+			File img = f.getFile(ext);
 
-		log.debug("##### convertImage destinationFile: " + jpg);
-
-		returnMap.addItem("processJPG", convertSingleJpg(img, jpg));
-		returnMap.addItem("processThumb", generateThumbs.generateThumb(thumbImagePrefix, jpg, 50));
-
+			log.debug("##### convertImage destinationFile: " + jpg);
+			returnMap.addItem("processJPG", convertSingleJpg(img, jpg));
+		}
+		ConverterProcessResult res = ProcessHelper.executeScript("get image dimensions :: " + f.getId()
+				, new String[] {getPathToIdentify(), "-format", "%wx%h", jpg.getCanonicalPath()});
+		returnMap.addItem("get JPG dimensions", res);
+		Dimension dim = getDimension(res.getOut());
+		f.setWidth(dim.width);
+		f.setHeight(dim.height);
 		return returnMap;
 	}
 
 	public ConverterProcessResultList convertImageUserProfile(File file, Long userId, boolean skipConvertion) throws Exception {
 		ConverterProcessResultList returnMap = new ConverterProcessResultList();
-		
+
 		// User Profile Update
 		File[] files = getUploadProfilesUserDir(userId).listFiles(new FileFilter() {
 			@Override
@@ -78,14 +79,13 @@ public class GenerateImage extends BaseC
 				FileUtils.deleteQuietly(f);
 			}
 		}
-		
+
 		File destinationFile = OmFileHelper.getNewFile(getUploadProfilesUserDir(userId), profileFileName, EXTENSION_JPG);
 		if (!skipConvertion) {
 			returnMap.addItem("processJPG", convertSingleJpg(file, destinationFile));
 		} else {
 			FileUtils.copyFile(file, destinationFile);
 		}
-		returnMap.addItem("processThumb2", generateThumbs.generateThumb(profileImagePrefix, destinationFile, 126));
 
 		if (!skipConvertion) {
 			// Delete old one
@@ -106,20 +106,40 @@ public class GenerateImage extends BaseC
 
 	/**
 	 * -density 150 -resize 800
-	 * @throws IOException 
-	 * 
+	 * @throws IOException
+	 *
 	 */
 	private ConverterProcessResult convertSingleJpg(File in, File out) throws IOException {
-		String[] argv = new String[] { getPathToImageMagick(), in.getCanonicalPath(), out.getCanonicalPath() };
+		String[] argv = new String[] { getPathToConvert(), in.getCanonicalPath(), out.getCanonicalPath() };
 
 		return ProcessHelper.executeScript("convertSingleJpg", argv);
 	}
 
 	public ConverterProcessResult resize(File in, File out, Integer width, Integer height) throws IOException {
-		String[] argv = new String[] { getPathToImageMagick()
+		String[] argv = new String[] { getPathToConvert()
 				, "-resize", (width == null ? "" : width) + (height == null ? "" : "x" + height)
 				, in.getCanonicalPath(), out.getCanonicalPath()
 				};
 		return ProcessHelper.executeScript("GenerateImage::resize", argv);
 	}
+
+	public ConverterProcessResult decodePDF(String inputfile, String outputfile) {
+		log.debug("decodePDF");
+		String[] argv = new String[] { getPathToConvert(), inputfile, outputfile };
+
+		return ProcessHelper.executeScript("generateBatchThumbByWidth", argv);
+	}
+
+	public ConverterProcessResult generateBatchThumb(File in, File outDir, Integer thumbSize, String pre) throws IOException {
+		log.debug("generateBatchThumbByWidth");
+		String[] argv = new String[] {
+			getPathToConvert()
+			, "-thumbnail" // FIXME
+			, "" + thumbSize
+			, in.getCanonicalPath()
+			, new File(outDir, "_" + pre + "_page-%04d.jpg").getCanonicalPath()
+			};
+
+		return ProcessHelper.executeScript("generateBatchThumbByWidth", argv);
+	}
 }

Modified: openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/file/FileProcessor.java
URL: http://svn.apache.org/viewvc/openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/file/FileProcessor.java?rev=1789036&r1=1789035&r2=1789036&view=diff
==============================================================================
--- openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/file/FileProcessor.java (original)
+++ openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/file/FileProcessor.java Tue Mar 28 03:19:16 2017
@@ -19,7 +19,6 @@
 package org.apache.openmeetings.core.data.file;
 
 import static org.apache.openmeetings.util.OmFileHelper.getFileExt;
-import static org.apache.openmeetings.util.OmFileHelper.thumbImagePrefix;
 import static org.apache.openmeetings.util.OpenmeetingsVariables.webAppRootKey;
 
 import java.io.File;
@@ -28,10 +27,9 @@ import java.util.List;
 import java.util.UUID;
 
 import org.apache.commons.io.FileUtils;
+import org.apache.openmeetings.core.converter.DocumentConverter;
 import org.apache.openmeetings.core.converter.FlvExplorerConverter;
-import org.apache.openmeetings.core.converter.GenerateImage;
-import org.apache.openmeetings.core.converter.GenerateThumbs;
-import org.apache.openmeetings.core.documents.GeneratePDF;
+import org.apache.openmeetings.core.converter.ImageConverter;
 import org.apache.openmeetings.db.dao.file.FileExplorerItemDao;
 import org.apache.openmeetings.db.entity.file.FileExplorerItem;
 import org.apache.openmeetings.db.entity.file.FileItem.Type;
@@ -51,11 +49,9 @@ public class FileProcessor {
 	@Autowired
 	private FileExplorerItemDao fileDao;
 	@Autowired
-	private GenerateImage generateImage;
+	private ImageConverter imageConverter;
 	@Autowired
-	private GenerateThumbs generateThumbs;
-	@Autowired
-	private GeneratePDF generatePDF;
+	private DocumentConverter generatePDF;
 
 	//FIXME TODO this method need to be refactored to throw exceptions
 	public ConverterProcessResultList processFile(FileExplorerItem f, InputStream is) throws Exception {
@@ -116,13 +112,10 @@ public class FileProcessor {
 			returnError = generatePDF.convertPDF(f, ext);
 		} else if (isChart) {
 			log.debug("uploaded chart file");
-		} else if (isImage && !isAsIs) {
+		} else if (isImage) {
 			// convert it to JPG
 			log.debug("##### convert it to JPG: ");
-			returnError = generateImage.convertImage(f, ext);
-		} else if (isAsIs) {
-			ConverterProcessResult processThumb = generateThumbs.generateThumb(thumbImagePrefix, file, 50);
-			returnError.addItem("processThumb", processThumb);
+			returnError = imageConverter.convertImage(f, ext);
 		} else if (isVideo) {
 			List<ConverterProcessResult> returnList = flvExplorerConverter.convertToMP4(f, ext);
 

Modified: openmeetings/application/trunk/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java
URL: http://svn.apache.org/viewvc/openmeetings/application/trunk/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java?rev=1789036&r1=1789035&r2=1789036&view=diff
==============================================================================
--- openmeetings/application/trunk/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java (original)
+++ openmeetings/application/trunk/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java Tue Mar 28 03:19:16 2017
@@ -35,6 +35,7 @@ import static org.apache.openmeetings.ut
 import static org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_FRONTEND_REGISTER_KEY;
 import static org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_GOOGLE_ANALYTICS_CODE;
 import static org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_IGNORE_BAD_SSL;
+import static org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_IMAGEMAGIC_PATH;
 import static org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_LOGIN_MIN_LENGTH_KEY;
 import static org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_MAX_UPLOAD_SIZE_KEY;
 import static org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_OAUTH_REGISTER_KEY;
@@ -243,7 +244,7 @@ public class ImportInitvalues {
 
 		cfgDao.add("swftools_path", cfg.swfPath, null, "Path To SWF-Tools");
 
-		cfgDao.add("imagemagick_path", cfg.imageMagicPath, null, "Path to ImageMagick tools");
+		cfgDao.add(CONFIG_IMAGEMAGIC_PATH, cfg.imageMagicPath, null, "Path to ImageMagick tools");
 
 		cfgDao.add("sox_path", cfg.soxPath, null, "Path To SoX-Tools");
 

Modified: openmeetings/application/trunk/openmeetings-util/src/main/java/org/apache/openmeetings/util/OpenmeetingsVariables.java
URL: http://svn.apache.org/viewvc/openmeetings/application/trunk/openmeetings-util/src/main/java/org/apache/openmeetings/util/OpenmeetingsVariables.java?rev=1789036&r1=1789035&r2=1789036&view=diff
==============================================================================
--- openmeetings/application/trunk/openmeetings-util/src/main/java/org/apache/openmeetings/util/OpenmeetingsVariables.java (original)
+++ openmeetings/application/trunk/openmeetings-util/src/main/java/org/apache/openmeetings/util/OpenmeetingsVariables.java Tue Mar 28 03:19:16 2017
@@ -48,6 +48,7 @@ public class OpenmeetingsVariables {
 	public static final String CONFIG_DEFAULT_GROUP_ID = "default_group_id";
 	public static final String CONFIG_GOOGLE_ANALYTICS_CODE = "google.analytics.code";
 	public static final String CONFIG_SYSTEM_EMAIL = "system_email_addr";
+	public static final String CONFIG_IMAGEMAGIC_PATH = "imagemagick_path";
 	public static final String MENU_ROOMS_NAME = "Conference Rooms";
 	public static final int RECENT_ROOMS_COUNT = 5;
 	public static final int LEVEL_USER = 1;