@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN')")
    @PutMapping(IMAGE_URL + "/info")
    public TbResourceInfo updateImageInfo(@Parameter(description = IMAGE_TYPE_PARAM_DESCRIPTION, schema = @Schema(allowableValues = {"tenant", "system"}), required = true)
                                          @PathVariable String type,
                                          @Parameter(description = IMAGE_KEY_PARAM_DESCRIPTION, required = true)
                                          @PathVariable String key,
                                          @RequestBody TbResourceInfo request) throws ThingsboardException {
        TbResourceInfo imageInfo = checkImageInfo(type, key, Operation.WRITE);
        TbResourceInfo newImageInfo = new TbResourceInfo(imageInfo);
        newImageInfo.setTitle(request.getTitle());
        return tbImageService.save(newImageInfo, imageInfo, getCurrentUser());
    }
@Test
    public void testUpdateImageInfo() throws Exception {
        String filename = "my_png_image.png";
        TbResourceInfo imageInfo = uploadImage(HttpMethod.POST, "/api/image", filename, "image/png", PNG_IMAGE);
        ImageDescriptor imageDescriptor = imageInfo.getDescriptor(ImageDescriptor.class);

        assertThat(imageInfo.getTitle()).isEqualTo(filename);
        assertThat(imageInfo.getResourceKey()).isEqualTo(filename);
        assertThat(imageInfo.getFileName()).isEqualTo(filename);

        String newTitle = "My PNG image";
        TbResourceInfo newImageInfo = new TbResourceInfo(imageInfo);
        newImageInfo.setTitle(newTitle);
        newImageInfo.setDescriptor(JacksonUtil.newObjectNode());
        newImageInfo = doPut("/api/images/tenant/" + filename + "/info", newImageInfo, TbResourceInfo.class);

        assertThat(newImageInfo.getTitle()).isEqualTo(newTitle);
        assertThat(newImageInfo.getDescriptor(ImageDescriptor.class)).isEqualTo(imageDescriptor);
        assertThat(newImageInfo.getResourceKey()).isEqualTo(imageInfo.getResourceKey());
        assertThat(newImageInfo.getPublicResourceKey()).isEqualTo(newImageInfo.getPublicResourceKey());
    }