Package ru.org.linux.gallery

Examples of ru.org.linux.gallery.Screenshot


      if (message.length() > MAX_MESSAGE_LENGTH) {
        errors.rejectValue("msg", null, "Слишком большое сообщение");
      }
    }

    Screenshot scrn = null;

    if (section!=null && groupPermissionService.isImagePostingAllowed(section, tmpl.getCurrentUser())) {
      scrn = processUpload(session, image, errors);

      if (section.isImagepost() && scrn == null && !errors.hasErrors()) {
        errors.reject(null, "Изображение отсутствует");
      }
    }

    Poll poll = null;
   
    if (section!=null && section.isPollPostAllowed()) {
      poll = preparePollPreview(form);
    }

    Topic previewMsg = null;

    if (group!=null) {
      previewMsg = new Topic(form, user, request.getRemoteAddr());

      Image imageObject = null;

      if (scrn!=null) {
        imageObject = new Image(
                0,
                0,
                "gallery/preview/" + scrn.getMainFile().getName(),
                "gallery/preview/" + scrn.getIconFile().getName()
        );
      }

      List<String> tagNames = TagName.parseAndSanitizeTags(form.getTags());
View Full Code Here


  ) throws IOException {
    if (session==null) {
      return null;
    }

    Screenshot screenShot = null;

    if (image != null && !image.isEmpty()) {
      File uploadedFile = new File(image);

      try {
        screenShot = Screenshot.createScreenshot(
                uploadedFile,
                errors,
                siteConfig.getHTMLPathPrefix() + "/gallery/preview"
        );

        if (screenShot != null) {
          logger.info("SCREEN: " + uploadedFile.getAbsolutePath() + "\nINFO: SCREEN: " + image);

          session.setAttribute("image", screenShot);
        }
      } catch (BadImageException e) {
        errors.reject(null, "Некорректное изображение: " + e.getMessage());
      }
    } else if (session.getAttribute("image") != null && !"".equals(session.getAttribute("image"))) {
      screenShot = (Screenshot) session.getAttribute("image");

      if (!screenShot.getMainFile().exists()) {
        screenShot = null;
      }
    }

    return screenShot;
View Full Code Here

    if (section.isImagepost() && scrn == null) {
      throw new ScriptErrorException("scrn==null!?");
    }

    if (scrn!=null) {
      Screenshot screenShot = scrn.moveTo(siteConfig.getHTMLPathPrefix() + "/gallery", Integer.toString(msgid));

      imageDao.saveImage(
              msgid,
              "gallery/" + screenShot.getMainFile().getName(),
              "gallery/" + screenShot.getIconFile().getName()
      );
    }

    if (section.isPollPostAllowed()) {
      pollDao.createPoll(Arrays.asList(form.getPoll()), form.isMultiSelect(), msgid);
View Full Code Here

TOP

Related Classes of ru.org.linux.gallery.Screenshot

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.