A photo manager for VRChat.

fix photos being loaded with the wrong resolution

phaz.uk d4078e02 d936ae1c

verified
Changed files
+26 -18
src
src-tauri
src
frontend_calls
+2 -1
changelog
··· 112 112 - Fixed scroll to top button being ontop of filters menu 113 113 - Fixed photo ordering 114 114 - Fixed automatic updates 115 - - Fixed broken legacy named photos 115 + - Fixed broken legacy named photos 116 + - Fixed photos being loaded with the wrong resolution
-2
src-tauri/src/frontend_calls/load_photos.rs
··· 11 11 size: usize, 12 12 } 13 13 14 - // TODO: Multi-layer photos 15 - 16 14 #[tauri::command] 17 15 pub fn load_photos(window: tauri::Window, cache: State<Cache> ) { 18 16 let base_dir = cache.get("photo-path".into()).unwrap();
+2 -2
src/Components/Managers/PhotoListRenderingManager.tsx
··· 124 124 let photo = (el as PhotoListPhoto).Photo; 125 125 126 126 // === DEBUG === 127 - // ctx.strokeStyle = '#f00'; 128 - // ctx.strokeRect((rowXPos - row.Width / 2) + canvas.width / 2, currentY - scroll, photo.scaledWidth!, row.Height); 127 + ctx.strokeStyle = '#f00'; 128 + ctx.strokeRect((rowXPos - row.Width / 2) + canvas.width / 2, currentY - scroll, photo.scaledWidth!, row.Height); 129 129 130 130 if(!photo.loaded) 131 131 // If the photo is not loaded, start a new task and load it in that task
+4 -1
src/Components/Managers/PhotoManager.tsx
··· 89 89 }); 90 90 91 91 this.Photos = MergeSort(this.Photos); 92 - console.log(this.Photos); 92 + console.log(this.Photos[0]); 93 93 94 94 console.log(this.Photos.length + ' Photos found.'); 95 + 95 96 if(this.Photos.length === 0 || photoPaths.length > Vars.MAX_PHOTOS_BULK_LOAD){ 96 97 console.log('No photos found or over bulk load limit, Skipping loading stage.'); 97 98 ··· 128 129 129 130 photo.metaLoaded = true; 130 131 photo.onMetaLoaded(); 132 + 133 + window.PhotoListRenderingManager.ComputeLayout(); 131 134 132 135 if(this._amountLoaded === this.Photos.length - 1 && !this.HasFirstLoaded){ 133 136 this.FilteredPhotos = this.Photos;
-1
src/Components/PhotoList.tsx
··· 154 154 }) 155 155 156 156 window.PhotoListRenderingManager.SetCanvas(photoContainer!); 157 - window.PhotoListRenderingManager.ComputeLayout(); 158 157 159 158 render(); 160 159 });
+7
src/Components/PhotoViewer.tsx
··· 367 367 ) 368 368 } 369 369 370 + let toggleLayerManager = () => { 371 + 372 + } 373 + 374 + // TODO: Make layers selectable 375 + 370 376 return ( 371 377 <div class="photo-viewer" ref={( el ) => viewer = el}> 372 378 <div class="photo-context-menu" ref={( el ) => viewerContextMenu = el}> ··· 442 448 443 449 <Show when={window.PhotoViewerManager.CurrentPhoto()?.isMultiLayer}> 444 450 <div class="viewer-button" 451 + onClick={toggleLayerManager} 445 452 onMouseOver={( el ) => animate(el.currentTarget, { width: '40px', height: '40px', 'margin-left': '15px', 'margin-right': '15px', 'margin-top': '-10px' })} 446 453 onMouseLeave={( el ) => animate(el.currentTarget, { width: '30px', height: '30px', 'margin-left': '20px', 'margin-right': '20px', 'margin-top': '0px' })} 447 454 >
+11 -11
src/Components/Structs/Photo.ts
··· 75 75 else 76 76 resSplit = split[3].split('x') 77 77 78 - let width = parseInt(resSplit[0]); 79 - let height = parseInt(resSplit[1]); 78 + // let width = parseInt(resSplit[0]); 79 + // let height = parseInt(resSplit[1]); 80 80 81 - if(!isNaN(width) || !isNaN(height)){ 82 - this.width = width; 83 - this.height = height; 84 - 85 - let scale = Vars.PHOTO_HEIGHT / this.height; 86 - 87 - this.scaledWidth = this.width * scale; 88 - this.scaledHeight = Vars.PHOTO_HEIGHT; 89 - } 81 + // if(!isNaN(width) || !isNaN(height)){ 82 + // this.width = width; 83 + // this.height = height; 84 + 85 + // let scale = Vars.PHOTO_HEIGHT / this.height; 86 + 87 + // this.scaledWidth = this.width * scale; 88 + // this.scaledHeight = Vars.PHOTO_HEIGHT; 89 + // } 90 90 } 91 91 92 92 loadMeta(){