Compare commits

..

No commits in common. "495bc9b3ae6f11bd793f45373feb7045503edae7" and "74119f72223091394d165aca92a6f77315518984" have entirely different histories.

2 changed files with 7 additions and 19 deletions

View File

@ -84,7 +84,7 @@
<div class="col-md-3"> <div class="col-md-3">
<div class="card bg-light"> <div class="card bg-light">
<div class="card-body text-center"> <div class="card-body text-center">
<h6>Total Products Registered</h6> <h6>Total Items Registered</h6>
<h3>{{ reportData.itemCountRegistered }}</h3> <h3>{{ reportData.itemCountRegistered }}</h3>
</div> </div>
</div> </div>

View File

@ -1358,28 +1358,16 @@ namespace PSTW_CentralSystem.Controllers.API.Inventory
} }
private bool IsImage(byte[] bytes) private bool IsImage(byte[] bytes)
{ {
if (bytes.Length < 4) return false; // JPEG file signature: FF D8 FF
if (bytes.Length > 2 && bytes[0] == 0xFF && bytes[1] == 0xD8 && bytes[2] == 0xFF)
// JPEG: Starts with FF D8
if (bytes[0] == 0xFF && bytes[1] == 0xD8)
return true; return true;
// PNG: 89 50 4E 47 // PNG file signature: 89 50 4E 47 0D 0A 1A 0A
if (bytes[0] == 0x89 && bytes[1] == 0x50 && bytes[2] == 0x4E && bytes[3] == 0x47) if (bytes.Length > 7 && bytes[0] == 0x89 && bytes[1] == 0x50 && bytes[2] == 0x4E && bytes[3] == 0x47)
return true; return true;
// GIF: GIF8 // GIF file signature: GIF87a or GIF89a
if (bytes[0] == 0x47 && bytes[1] == 0x49 && bytes[2] == 0x46) if (bytes.Length > 5 && bytes[0] == 0x47 && bytes[1] == 0x49 && bytes[2] == 0x46)
return true;
// WebP: Starts with 'RIFF' and has 'WEBP' at offset 8
if (bytes.Length > 12 &&
bytes[0] == 0x52 && bytes[1] == 0x49 && bytes[2] == 0x46 && bytes[3] == 0x46 && // RIFF
bytes[8] == 0x57 && bytes[9] == 0x45 && bytes[10] == 0x42 && bytes[11] == 0x50) // WEBP
return true;
// HEIC (iPhone): Look for 'ftypheic' or 'ftypmif1'
if (bytes.Length > 12 && bytes[4] == 0x66 && bytes[5] == 0x74 && bytes[6] == 0x79 && bytes[7] == 0x70)
return true; return true;
return false; return false;