Ticket #82 (closed enhancement: fixed)

Opened 4 years ago

Last modified 22 months ago

Watermarking stills

Reported by: MC-arjen Owned by: robert
Priority: major Milestone: MediaMosa 3.0
Component: 2.4 issue Version:
Keywords: Cc:
MoSCoW: Must Have Estimated time after impact analysis:
Related to project: none Tested: yes
Accepted: yes Estimated Hours:

Description (last modified by MC-arjen) (diff)

* Original request: To give possibilities to watermarking stills.
* Consideration:
- How many watermark image per client, per asset, per mediafile?
- Rest call improvement to upload watermark images.
- Mediafile table improvement to store stills.
* Possible solution:
Users upload their watermark image(s) by rest calls.
VPX store the watermark images in mediafile table.
After the vpx-transcode a PHP code with GD merge the still with the watermark image.

Change History

Changed 4 years ago by MC-arjen

  • description modified (diff)

We want to store watermarks as a mediafile in a egabucket, which is not an asset. An egabucket has zero, one or more mediafiles. We need upload with the existing restcalls.

The still rest call needs an addition parameter : watermark mediafile_id.

(later also for: logo's, footers, banners.)

Changed 4 years ago by MC-arjen

  • related_to set to Rich Media

Changed 4 years ago by MC-arjen

  • owner set to forgacs
  • status changed from new to assigned

Changed 4 years ago by forgacs

Watermark plan


Upload watermark as a picture


  • /watermark/upload
  • POST: upload_ticket, redirect_uri, file

Delete watermark


  • /watermark/{watermark_id}/delete
  • URL: watermark_id
  • POST: user_id,

Get watermarks


  • /watermark
  • POST: user_id, may have: watermark_id

Additional POST paramerets, if there is a still creation or still upload:


  • watermark_id - If watermark_id is exist, then additional parameters may exist too:
  • dst_x - x-coordinate of destination point (still)
  • dst_y - y-coordinate of destination point
  • pct - alpha transparency (watermark visibility in percentage [0 - 100%])
  • v_align - vertical align: {left, right} default 'left'
  • h_align - horizontal align: {top, bottom} default 'top'

In the case of vertical align = left, the dst_x is 'o' (see the picture), calculates from the left side.
Otherwise in the case of vertical align= right, the dst_x is 'x', calculates from the right side.

-----------------------------------------------
|                      still                  |
|  o----------------       ----------------x  |
|  | watermark     |       | watermark     |  |
|  -----------------       -----------------  |
|                                             |
|                                             |
-----------------------------------------------

The PHP code use GD (imagecopymerge()) to watermarking images.

If a still was created (and watermarked), it is not possible to watermark again.
Watermarks for client application, not for asset or mediafile. And the users can upload more the one watermarks for their client application.
The watermarks is stored in a special asset, calls 'egabucket'. The contents of the egabucket is not browsable, and not visible in other REST calls, nor with other stills or mediafiles.

Consideration for later development


Logos, footers, banners storage as mediafiles.


Upload special picture


  • /special/upload
  • POST: upload_ticket, redirect_uri, file, type = {logo, footer, banner}

Delete special


  • /special/{special_id}/delete
  • URL: special_id
  • POST: user_id,

Get specials


  • /special
  • POST: user_id, may have: spacial_id, type

The specials is stored in a special asset, calls 'egabucket'. The contents of the egabucket is not browsable, and not visible in other REST calls, nor with other stills or mediafiles.

Changed 4 years ago by forgacs

Egabucket


A new REST call will be introduce for exclude assets from searches (REST calls, OAI).
Egabucket is an exluded asset.

Exlude asset


  • /asset/{asset_id}/exclude
  • URL: asset_id
  • POST: user_id, excluded={TRUE, FALSE} sets the asset excluded or included (searchable again)

Set asset as watermark asset


  • /asset/{asset_id}/watermark
  • URL: asset_id
  • POST: user_id

Changed 4 years ago by forgacs

This won't be ready in Mediamosa 1.7.

Changed 3 years ago by Frans

  • milestone changed from MediaMosa 1.7 to MediaMosa 2.1

Still need 2 days work.

Moved to MediaMosa 2.1

Changed 3 years ago by Frans

  • moscow set to Could Have

Changed 3 years ago by Frans

  • milestone changed from MediaMosa 2.1 to MediaMosa 2.2

Changed 3 years ago by forgacs

  • owner changed from forgacs to arjen

Changed 3 years ago by Frans

  • moscow changed from Could Have to Should Have
  • milestone changed from MediaMosa 2.2 to MediaMosa 2.3

Changed 3 years ago by robert

/watermark imo should be /still/watermark/ or mediafile/still/watermark

This ticket only focuses on watermarking of stills. Also remember that real time watermarking is not smart.

Changed 2 years ago by MC-arjen

  • owner arjen deleted

Changed 2 years ago by Frans

  • moscow changed from Should Have to Must Have
  • related_to changed from Rich Media to none
  • milestone changed from MediaMosa 2.3 to MediaMosa 3.0

Changed 2 years ago by Frans

  • milestone changed from MediaMosa 3.0 to MediaMosa 2.4

Changed 2 years ago by forgacs

  • owner set to forgacs

Watermarking stills


New REST call


still/$still_id/watermark [POST]
Required: $watermark_id

Watermark id is the still id. Any (JPG, PNG) still can be watermark still.

Additional POST paramerets, if there is a still creation or still upload or still/$still_id/watermark:


  • watermark_id - If watermark_id is exist, then additional parameters may exist too:
  • dst_x - x-coordinate of destination point (still)
  • dst_y - y-coordinate of destination point
  • pct - alpha transparency (watermark visibility in percentage [0 - 100%])
  • v_align - vertical align: {left, right} default 'left'
  • h_align - horizontal align: {top, bottom} default 'top'

In the case of vertical align = left, the dst_x is 'o' (see the picture), calculates from the left side.
Otherwise in the case of vertical align= right, the dst_x is 'x', calculates from the right side.

-----------------------------------------------
|                      still                  |
|  o----------------       ----------------x  |
|  | watermark     |       | watermark     |  |
|  -----------------       -----------------  |
|                                             |
|                                             |
-----------------------------------------------

The PHP code uses GD (imagecopymerge()) to watermarking images.

Changed 2 years ago by forgacs

  • owner changed from forgacs to robert

@Robert: Please, review my changes.

The new REST call (/still/$still_id/watermark) is in this file:
sites/all/modules/mediamosa/modules/asset/mediafile/still/mediamosa_asset_mediafile_still.rest.inc

Test is in the same directory: mediamosa_asset_mediafile_still.watermark.test

The new REST parameters were implemented for these REST calls:

/still/$still_id/watermark [POST]

/asset/$asset_id/still/create [POST]
/mediafile/$mediafile_id/still/create [POST]
/mediafile/$mediafile_id/transcode [POST]

/mediafile/$mediafile_id/upload [PUT]
/mediafile/upload [POST]
/mediafile/upload [PUT]

/asset/$asset_id/still/upload [POST]
/asset/$asset_id/still/upload [PUT]

Changed 2 years ago by robert

  • status changed from assigned to closed
  • resolution set to fixed

Reviewed.

Changed 22 months ago by Frans

  • component changed from Core to 2.4 issue
  • milestone changed from MediaMosa 2.4 to MediaMosa 3.0

Changed 22 months ago by forgacs

We use app_id = 1 for testing acceptation.

Example asset: /asset/z1bjdId3ZFB9UNkHRkqz3pft

Example POST call: /still/J2fgXlbnanlpbtUbJDXRJSap/watermark
Parameter: watermark_id=uLLdRNin9WVWKXjnO3hrJGyB

Watermarked still_id = U23iNGmYkROJQQkKmJdKDt6Q

Other parameters:
dst_x - x-coordinate of destination point (still)
dst_y - y-coordinate of destination point
pct - alpha transparency (watermark visibility in percentage [0 - 100%])
v_align - vertical align: {left, right} default 'left'
h_align - horizontal align: {top, bottom} default 'top'

Changed 22 months ago by Frans

  • tested set to yes
  • accepted changed from no to yes

Tested succesfully. Also with the parameters
watermark_dst_x
watermark_dst_y
watermark_h_align
watermark_v_align
watermark_pct

Note: See TracTickets for help on using tickets.