Reduce verbosity of sensitive data
This commit is contained in:
@@ -46,14 +46,6 @@
|
|||||||
async function forceMemoryCleanup() {
|
async function forceMemoryCleanup() {
|
||||||
await tf.nextFrame(); // Wait for any pending GPU operations
|
await tf.nextFrame(); // Wait for any pending GPU operations
|
||||||
|
|
||||||
// Log memory state without aggressive cleanup
|
|
||||||
const memInfo = tf.memory();
|
|
||||||
console.log('Memory status:', {
|
|
||||||
tensors: memInfo.numTensors,
|
|
||||||
dataBuffers: memInfo.numDataBuffers,
|
|
||||||
bytes: memInfo.numBytes
|
|
||||||
});
|
|
||||||
|
|
||||||
// Only run garbage collection if available, don't dispose variables
|
// Only run garbage collection if available, don't dispose variables
|
||||||
if (typeof window !== 'undefined' && 'gc' in window) {
|
if (typeof window !== 'undefined' && 'gc' in window) {
|
||||||
(window as any).gc();
|
(window as any).gc();
|
||||||
@@ -151,7 +143,6 @@
|
|||||||
|
|
||||||
if (isGoogleDriveUrl(photo.url)) {
|
if (isGoogleDriveUrl(photo.url)) {
|
||||||
// Download from Google Drive
|
// Download from Google Drive
|
||||||
console.log(`Downloading from Google Drive: ${photo.name}`);
|
|
||||||
blob = await downloadDriveImage(photo.url);
|
blob = await downloadDriveImage(photo.url);
|
||||||
} else {
|
} else {
|
||||||
// For direct URLs, convert to blob
|
// For direct URLs, convert to blob
|
||||||
@@ -165,7 +156,6 @@
|
|||||||
blob.type === 'image/heif' ||
|
blob.type === 'image/heif' ||
|
||||||
photo.url.toLowerCase().endsWith('.heic')
|
photo.url.toLowerCase().endsWith('.heic')
|
||||||
) {
|
) {
|
||||||
console.log(`HEIC detected for ${photo.name}. Starting conversion in background.`);
|
|
||||||
photo.status = 'loading'; // Visually indicate something is happening
|
photo.status = 'loading'; // Visually indicate something is happening
|
||||||
// Don't await this, let it run in the background
|
// Don't await this, let it run in the background
|
||||||
convertHeicPhoto(index, blob);
|
convertHeicPhoto(index, blob);
|
||||||
@@ -185,8 +175,6 @@
|
|||||||
async function convertHeicPhoto(index: number, blob: Blob) {
|
async function convertHeicPhoto(index: number, blob: Blob) {
|
||||||
const photo = photos[index];
|
const photo = photos[index];
|
||||||
try {
|
try {
|
||||||
console.log(`Converting HEIC with heic-convert for ${photo.name}...`);
|
|
||||||
|
|
||||||
// Dynamically import the browser-specific version of the library
|
// Dynamically import the browser-specific version of the library
|
||||||
const { default: convert } = await import('heic-convert/browser');
|
const { default: convert } = await import('heic-convert/browser');
|
||||||
|
|
||||||
@@ -199,8 +187,6 @@
|
|||||||
|
|
||||||
const convertedBlob = new Blob([outputBuffer], { type: 'image/jpeg' });
|
const convertedBlob = new Blob([outputBuffer], { type: 'image/jpeg' });
|
||||||
|
|
||||||
console.log(`Successfully converted HEIC for ${photo.name}`);
|
|
||||||
|
|
||||||
// Now that it's converted, process it like any other image
|
// Now that it's converted, process it like any other image
|
||||||
await processLoadedBlob(index, convertedBlob);
|
await processLoadedBlob(index, convertedBlob);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@@ -229,7 +215,6 @@
|
|||||||
|
|
||||||
photo.objectUrl = objectUrl;
|
photo.objectUrl = objectUrl;
|
||||||
photo.status = 'success';
|
photo.status = 'success';
|
||||||
console.log(`Photo loaded successfully: ${photo.name}`);
|
|
||||||
|
|
||||||
// Save blob to IndexedDB instead of the store
|
// Save blob to IndexedDB instead of the store
|
||||||
await set(photo.url, blob);
|
await set(photo.url, blob);
|
||||||
|
|||||||
Reference in New Issue
Block a user