This is the archived documentation for Doka Image Editor v6.

Please visit pqina.nl/pintura/docs/ to see documentation for the latest version of Pintura Image Editor.

FAQ

A growing list of frequently asked questions.

Why does Doka throw a CORS error when processing the image?

The most likely cause of these issues is an incorrectly configured CORS policy on a remote server. A resource is deemed remote when it has a different domain, subdomain, protocol, or port as the local server.

Some examples of cross-origin requests:

https://my-site.com -> https://your-site.com
https://my-site.com -> https://sub.my-site.com
https://my-site.com -> http://my-site.com
https://my-site.com -> http://my-site.com:1234

We can determine if the CORS policy is configured incorrectly by looking at the network tab of our browser developer tools and inspecting the request. If the Access-Control response headers are turned CORS is configured.

Below we can see the results of loading a test image from the PQINA webserver:

Request Headers
  Url: https://pqina.nl/doka/cors/test.jpg
  Method: GET

Response Headers
  Access-Control-Allow-Methods: GET
  Access-Control-Allow-Origin: *
  Content-Type: image/jpeg

A wildcard means that the file can be accessed from everywhere, it's best to set a specific origin.

Access-Control-Allow-Origin: https://my-site.com

If a specific origin is set (so no wildcard), we need to make sure the image is correctly cached as well. To do this we need to set the Vary header to Origin, see CORS and caching on MDN.

More information on setting a CORS policy:

S3 doesn't send the Vary: Origin header automatically whenever CORS is configured on a bucket, the Origin header needs to be present in the request for S3 to add it to Vary. See this Stack Overflow answer for solving CORS errors with S3.

If for some reason the remote CORS policy can't be changed we can proxy the image request through the local server. In that situation we send the URL of the remote image to our local server, our local server then requests the remote image and returns the result to the front-end.

Can I change the language?

The text used on each element can be changed with label properties. These properties should allow for enough flexibility to cover any internationalisation / i18n requirement.

Does Doka correct EXIF orientation information?

Doka will automatically correct the orientation of images when the outputCorrectImageExifOrientation is set to true (this is the default).

On export Doka will strip the EXIF header, to keep the header, please set outputStripImageHead to false

Can I limit the output size of the image?

You can set the maximum size of the output image using the outputWidth and outputHeight properties. By default these properties describe the max size of the output image, if the crop is smaller the output image will be smaller.

To upscale the image to fit the defined output size, set outputUpscale to true.