mirror of
				https://github.com/advplyr/audiobookshelf.git
				synced 2025-10-27 11:18:14 +01:00 
			
		
		
		
	Merge pull request #3492 from mikiher/author-image-ar
Use object-cover for author images unless AR is really high or low
This commit is contained in:
		
						commit
						a6da32430f
					
				| @ -65,15 +65,10 @@ export default { | ||||
|   }, | ||||
|   methods: { | ||||
|     imageLoaded() { | ||||
|       var aspectRatio = 1.25 | ||||
|       if (this.$refs.wrapper) { | ||||
|         aspectRatio = this.$refs.wrapper.clientHeight / this.$refs.wrapper.clientWidth | ||||
|       } | ||||
|       if (this.$refs.img) { | ||||
|         var { naturalWidth, naturalHeight } = this.$refs.img | ||||
|         var imgAr = naturalHeight / naturalWidth | ||||
|         var arDiff = Math.abs(imgAr - aspectRatio) | ||||
|         if (arDiff > 0.15) { | ||||
|         if (imgAr < 0.5 || imgAr > 2) { | ||||
|           this.showCoverBg = true | ||||
|         } else { | ||||
|           this.showCoverBg = false | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user