Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to Increase DPI of the image file using javascript?

I have used Fabric.js canvas and export image using dataurl() method. but it is export in 96 dpi image but I want to 300 dpi.

i have base64 string of image.

I have created a canvas in angular 6.

What I have tried:

first, I convert my base64 string of image into hex string then after replace 13 to 17 byte of an image which contains dpi value like '01 2c 01 2c' and then again convert into base64 but when I see image, it was an invalid image.

reference link : http://www.apptools.com/examples/dpi.php

I have also tried below link function but it also has invalid https://andreyvoev.com/programming/change-the-dpi-of-a-jpeg-image-with-php/
Posted
Updated 30-Jul-18 18:42pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900