| @@ 710-729 (lines=20) @@ | ||
| 707 | * @param int $page |
|
| 708 | * @return int |
|
| 709 | */ |
|
| 710 | public function getWidth( $page = 1 ) { |
|
| 711 | $this->load(); |
|
| 712 | ||
| 713 | if ( $this->isMultipage() ) { |
|
| 714 | $handler = $this->getHandler(); |
|
| 715 | if ( !$handler ) { |
|
| 716 | return 0; |
|
| 717 | } |
|
| 718 | $dim = $handler->getPageDimensions( $this, $page ); |
|
| 719 | if ( $dim ) { |
|
| 720 | return $dim['width']; |
|
| 721 | } else { |
|
| 722 | // For non-paged media, the false goes through an |
|
| 723 | // intval, turning failure into 0, so do same here. |
|
| 724 | return 0; |
|
| 725 | } |
|
| 726 | } else { |
|
| 727 | return $this->width; |
|
| 728 | } |
|
| 729 | } |
|
| 730 | ||
| 731 | /** |
|
| 732 | * Return the height of the image |
|
| @@ 737-756 (lines=20) @@ | ||
| 734 | * @param int $page |
|
| 735 | * @return int |
|
| 736 | */ |
|
| 737 | public function getHeight( $page = 1 ) { |
|
| 738 | $this->load(); |
|
| 739 | ||
| 740 | if ( $this->isMultipage() ) { |
|
| 741 | $handler = $this->getHandler(); |
|
| 742 | if ( !$handler ) { |
|
| 743 | return 0; |
|
| 744 | } |
|
| 745 | $dim = $handler->getPageDimensions( $this, $page ); |
|
| 746 | if ( $dim ) { |
|
| 747 | return $dim['height']; |
|
| 748 | } else { |
|
| 749 | // For non-paged media, the false goes through an |
|
| 750 | // intval, turning failure into 0, so do same here. |
|
| 751 | return 0; |
|
| 752 | } |
|
| 753 | } else { |
|
| 754 | return $this->height; |
|
| 755 | } |
|
| 756 | } |
|
| 757 | ||
| 758 | /** |
|
| 759 | * Returns ID or name of user who uploaded the file |
|