Automatization Plugin for OJS

We need a plugin for our OJS Project. Our Open Journal System Project is about administration of scientific lectures. We need a function that proves automatically the dpi in the picture. If you want to upload a picture in our ojs the function proves if you had the right size of dpi in your picture. We don’t need pictures that have a low amount of dpi.

Can anyone help us to solve the function?

Thank you.

For creating the image resolution / DPI detection in OJS it will require that PHP that will communicate with Imagick on your server. As the community discuss this using only PHP without Imagick will return the function that does not work for many picture formats.

This is a function to detect the DPI, source :

function getDPIImageMagick($filename){
        $cmd = 'identify -quiet -format "%x" '.$filename;       
        @exec(escapeshellcmd($cmd), $data);
        if($data && is_array($data)){
            $data = explode(' ', $data[0]);

            if($data[1] == 'PixelsPerInch'){
                return $data[0];
            }elseif($data[1] == 'PixelsPerCentimeter'){
                $x = ceil($data[0] * 2.54);
                return $x;
            }elseif($data[1] == 'Undefined'){
                return $data[0];
            }                       
        }
        return 72;
}

Currently, there is no available plugin for such plugin.

Hendra
OJT Team