크기 조정 기능을 사용하고 요약에 사용자가 표시 할 수있는 이미지의 비율을 얻고 싶습니다.PHP가 읽을 수있는 이미지의 비율
function getHumanRatio($width, $height){
// Do something over here.
}
echo getHumanRatio(1920, 1080) // 16:9
echo getHumanRatio(480, 360) // 4:3
echo getHumanRatio(360, 480) // 3:4
으로 내가 내 크기 조정 기능에서 사용 할뿐만 아니라 디스플레이/요약 함수에 말했지만 숫자 비율의 사용은 여기 helpfull되지 않습니다 는 basicly 나는 다음과 같이 작동하는 기능을합니다. (다음과 같이 계산 : $ratio = $oldWidth/$oldHeight;
를) 경우
확인이 링크 : HTTP : //codereview.stackexchange합니다. com/questions/26697/getting-the-smallest-possible-integer-ratio-between-two-numbers –