ImageService

In this article:

Warning

This init instance over Imcms.getServices().getImageService() working from 10 version

Use API

Init or get instance ImageService over global Imcms.getServices Imcms.getServices().getImageService();

Imcms.getServices().getImageService().getImage(ImageDTO dataHolder);

Imcms.getServices().getImageService().getImage(int docId, int index, String langCode, LoopEntryRef loopEntryRef);

Imcms.getServices().getImageService().getPublicImage(int docId, int index, String langCode, LoopEntryRef loopEntryRef);

Imcms.getServices().getImageService().getUsedImagesInWorkingAndLatestVersions(String imageURL);

Imcms.getServices().getImageService().getImagesAllVersionAndLanguages(int docId, Language language);

Imcms.getServices().getImageService().saveImage(ImageDTO imageDTO);

Imcms.getServices().getImageService().deleteByDocId(Integer docIdToDelete);

Imcms.getServices().getImageService().getPublicImageLinks(int docId, Language language);

Imcms.getServices().getImageService().deleteImage(ImageDTO imageDTO);

Description ImageDTO

Imcms support a few variables to create imageDTO -

ImageDTO image = new ImageDTO(Integer index, Integer docId, LoopEntryRef loopEntryRef, String langCode);

ImageDTO image = new ImageDTO(Integer index, Integer docId);

Description fields imageDTO

  1. setIndex(Integer) - no index image

  2. setDocId(Integer) - identified document where location image

  3. setInText(boolean) - location image into text-aria.

  4. setAllLanguage(boolean) - support all language image;

  5. setAlternateText(String) - alternative text for image;

  6. setSizeFormatted(String) - current size image (GB, Mb and etc)

  7. setLoopEntryRef(LoopEntryRefDTO) - location into loop-area. (Check about loopEntryRef in LoopService.)

  8. setFormat(Format) - set current format image;

  9. setCropRegion(ImageCropRegionDTO) - x1,x2,y1,y2 crop region for image;

  10. setSource(ImageSource)

  11. setSpaceAround(SpaceAroundDTO)

  12. setResize(Resize)

  13. setRotateDirection(RotateDirection)