@@ -34,30 +34,31 @@ export default class CanvasDownloadLinks extends Component {
3434 }
3535
3636 zoomedImageUrl ( ) {
37- const { canvas, fullSizeParam } = this . props ;
37+ const { canvas, isVersion3 } = this . props ;
3838 const bounds = this . currentBounds ( ) ;
3939 const boundsUrl = canvas
4040 . getCanonicalImageUri ( )
4141 . replace (
4242 / \/ f u l l \/ .* \/ 0 \/ / ,
43- `/${ bounds . x } ,${ bounds . y } ,${ bounds . width } ,${ bounds . height } /${ fullSizeParam } /0/` ,
43+ `/${ bounds . x } ,${ bounds . y } ,${ bounds . width } ,${ bounds . height } /${ isVersion3 ? ` ${ bounds . width } , ${ bounds . height } ` : 'full' } /0/` ,
4444 ) ;
4545
4646 return `${ boundsUrl } ?download=true` ;
4747 }
4848
4949 imageUrlForSize ( size ) {
50- const { canvas } = this . props ;
50+ const { canvas, isVersion3 } = this . props ;
5151
52- return `${ canvas . getCanonicalImageUri ( size . width ) } ?download=true` ;
52+ return isVersion3 ? `${ canvas . getCanonicalImageUri ( ) . replace ( / \/ f u l l \/ .* \/ 0 \/ / , `/full/${ size . width } ,${ size . height } /0/` ) } ?download=true`
53+ : `${ canvas . getCanonicalImageUri ( size . width ) } ?download=true` ;
5354 }
5455
5556 fullImageUrl ( ) {
56- const { canvas, fullSizeParam } = this . props ;
57+ const { canvas, isVersion3 } = this . props ;
5758
5859 return `${ canvas
5960 . getCanonicalImageUri ( )
60- . replace ( / \/ f u l l \/ .* \/ 0 \/ / , `/full/${ fullSizeParam } /0/` ) } ?download=true`;
61+ . replace ( / \/ f u l l \/ .* \/ 0 \/ / , `/full/${ isVersion3 ? 'max' : 'full' } /0/` ) } ?download=true`;
6162 }
6263
6364 thousandPixelWideImage ( ) {
@@ -223,7 +224,6 @@ CanvasDownloadLinks.propTypes = {
223224 getWidth : PropTypes . func . isRequired ,
224225 } ) . isRequired ,
225226 canvasLabel : PropTypes . string . isRequired , // canvasLabel is passed because we need access to redux
226- fullSizeParam : PropTypes . string . isRequired ,
227227 infoResponse : PropTypes . shape ( {
228228 json : PropTypes . shape ( {
229229 height : PropTypes . number ,
@@ -233,6 +233,7 @@ CanvasDownloadLinks.propTypes = {
233233 width : PropTypes . number ,
234234 } ) ,
235235 } ) . isRequired ,
236+ isVersion3 : PropTypes . bool . isRequired ,
236237 restrictDownloadOnSizeDefinition : PropTypes . bool . isRequired ,
237238 viewType : PropTypes . string . isRequired ,
238239 windowId : PropTypes . string . isRequired ,
0 commit comments