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