How to get the cropped image from media library?

Get the attachment ID for the image, then get the post meta field _wp_attachment_metadata for it. This is a serialized array. The field sizes in that array contains all available image sizes.

Pseudo-code:

$sizes = array();

$attachment_url="http://examle.com/wp-content-uploads/foo.png";
$attachment_dir  = dirname( $attachment_url );
$attachment_id   = get_attachment_id( $attachment_url );
$attachment_meta = get_post_meta( $attachment_id, '_wp_attachment_metadata', TRUE );

$sizes[] = $attachment_url; // main file

if ( ! empty ( $attachment_meta[ 'sizes' ] ) )
{
    foreach ( $attachment_meta[ 'sizes' ] as $size )
        $sizes[] = "$attachment_dir/" . $size[ 'file' ];
}

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)