| @@ 696-715 (lines=20) @@ | ||
| 693 | * @param int $page |
|
| 694 | * @return int |
|
| 695 | */ |
|
| 696 | public function getWidth( $page = 1 ) { |
|
| 697 | $this->load(); |
|
| 698 | ||
| 699 | if ( $this->isMultipage() ) { |
|
| 700 | $handler = $this->getHandler(); |
|
| 701 | if ( !$handler ) { |
|
| 702 | return 0; |
|
| 703 | } |
|
| 704 | $dim = $handler->getPageDimensions( $this, $page ); |
|
| 705 | if ( $dim ) { |
|
| 706 | return $dim['width']; |
|
| 707 | } else { |
|
| 708 | // For non-paged media, the false goes through an |
|
| 709 | // intval, turning failure into 0, so do same here. |
|
| 710 | return 0; |
|
| 711 | } |
|
| 712 | } else { |
|
| 713 | return $this->width; |
|
| 714 | } |
|
| 715 | } |
|
| 716 | ||
| 717 | /** |
|
| 718 | * Return the height of the image |
|
| @@ 723-742 (lines=20) @@ | ||
| 720 | * @param int $page |
|
| 721 | * @return int |
|
| 722 | */ |
|
| 723 | public function getHeight( $page = 1 ) { |
|
| 724 | $this->load(); |
|
| 725 | ||
| 726 | if ( $this->isMultipage() ) { |
|
| 727 | $handler = $this->getHandler(); |
|
| 728 | if ( !$handler ) { |
|
| 729 | return 0; |
|
| 730 | } |
|
| 731 | $dim = $handler->getPageDimensions( $this, $page ); |
|
| 732 | if ( $dim ) { |
|
| 733 | return $dim['height']; |
|
| 734 | } else { |
|
| 735 | // For non-paged media, the false goes through an |
|
| 736 | // intval, turning failure into 0, so do same here. |
|
| 737 | return 0; |
|
| 738 | } |
|
| 739 | } else { |
|
| 740 | return $this->height; |
|
| 741 | } |
|
| 742 | } |
|
| 743 | ||
| 744 | /** |
|
| 745 | * Returns ID or name of user who uploaded the file |
|