}
// Report converted object
{
File convertedFile = request.getOutFile();
SystemFile convertedSf = SystemFile.getSystemFile(convertedFile);
analyzedObj.put(UploadConstants.UPLOAD_STATUS_KEY, UploadConstants.UPLOAD_STATUS_WAITING_FOR_APPROVAL);
analyzedObj.put("conversionPerformed", request.isConversionPerformed());
analyzedObj.put(UploadConstants.MEDIA_FILE_KEY, convertedFile.getName());
analyzedObj.put(UploadConstants.SIZE_KEY, convertedFile.length());
analyzedObj.put(UploadConstants.MIME_KEY, convertedSf.getMimeType());
analyzedObj.put(UploadConstants.ENCODING_KEY, convertedSf.getMimeEncoding());
if( request.getOutHeight() != 0 && request.getOutWidth() != 0 ) {
analyzedObj.put("height", request.getOutHeight());
analyzedObj.put("width", request.getOutWidth());
}
}
// Report thumbnail object
if( request.isThumbnailCreated() ) {
File thumbFile = request.getThumbnailFile();
SystemFile thumbSf = SystemFile.getSystemFile(thumbFile);
String thumbnailAttachmentName = computeThumbnailName(analyzedObj.getString("attachmentName"));
JSONObject thumbnailObj = conversionContext.createAttachmentDescription(thumbnailAttachmentName);
thumbnailObj.put(UploadConstants.UPLOAD_STATUS_KEY, UploadConstants.UPLOAD_STATUS_WAITING_FOR_APPROVAL);
thumbnailObj.put(UploadConstants.MIME_CLASS_KEY, "image");
thumbnailObj.put("originalName", analyzedObj.opt("originalName"));
thumbnailObj.put(UploadConstants.MEDIA_FILE_KEY, thumbFile.getName());
thumbnailObj.put("source", analyzedObj.opt("attachmentName"));
thumbnailObj.put(UploadConstants.SIZE_KEY, thumbFile.length());
thumbnailObj.put(UploadConstants.MIME_KEY, thumbSf.getMimeType());
thumbnailObj.put(UploadConstants.ENCODING_KEY, thumbSf.getMimeEncoding());
if( request.getThumbnailHeight() != 0 && request.getThumbnailWidth() != 0 ) {
thumbnailObj.put("height", request.getThumbnailHeight());
thumbnailObj.put("width", request.getThumbnailWidth());
}