Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-16747

MultiviewPictureAdapter#viewToMap forgets ImageInfo

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.3
    • Component/s: Image Management
    • Tags:
    • Sprint:
      TGV 7.2-3
    • Story Points:
      2

      Description

      After using the MultiviewPictureAdapter to add a view, the UI is broken (see screenshot).

      I think it is because this code does not handle the ImageInfo of the view, while the widget displaying the views relies on these.

      Note: As I needed to make it work "now", I duplicated the viewToMap in my own plug-in, adding map.put(PictureView.FIELD_INFO, view.getImageInfo().toMap());, and all was good.

      Original code:

      // ...fill values (title, ...)
      MultiviewPicture mvp = inDoc.getAdapter(MultiviewPicture.class);
      PictureView view = mvp.getView(title);
      if(view != null) {
          mvp.removeView(title);
      }
      ImagingService imagingService = Framework.getService(ImagingService.class);
      ImageInfo info = imagingService.getImageInfo(croppedBlob);
      view = new PictureViewImpl();
      view.setBlob(croppedBlob);
      view.setDescription(title);
      view.setFilename(croppedBlob.getFilename());
      view.setHeight((int) height);
      view.setImageInfo(info);
      view.setTitle(title);
      view.setWidth((int) width);
      mvp.addView(view);
      // ... save doc, continue code ...
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: