feat(Images): update image handling to AVIF format across components
- Changed image file extensions from JPG to AVIF in data-fetching, product, category, and image components for improved performance and reduced file sizes. - Updated image blob creation to reflect the new AVIF format in various components, ensuring consistency in image handling throughout the application.
This commit is contained in:
@@ -305,7 +305,7 @@ class ProductDetailPage extends Component {
|
||||
window.socketManager.emit('getPic', { bildId, size: 'small' }, (res) => {
|
||||
if (res.success) {
|
||||
// Cache the image
|
||||
window.smallPicCache[bildId] = URL.createObjectURL(new Blob([res.imageBuffer], { type: 'image/jpeg' }));
|
||||
window.smallPicCache[bildId] = URL.createObjectURL(new Blob([res.imageBuffer], { type: 'image/avif' }));
|
||||
|
||||
// Update state
|
||||
this.setState(prevState => ({
|
||||
@@ -546,7 +546,7 @@ class ProductDetailPage extends Component {
|
||||
console.log("getAttributePicture", res);
|
||||
if (res.success && !res.noPicture) {
|
||||
const blob = new Blob([res.imageBuffer], {
|
||||
type: "image/jpeg",
|
||||
type: "image/avif",
|
||||
});
|
||||
const url = URL.createObjectURL(blob);
|
||||
|
||||
@@ -1047,7 +1047,7 @@ class ProductDetailPage extends Component {
|
||||
console.log('loadEmbeddedProductImage response:', articleNr, res.success);
|
||||
|
||||
if (res.success) {
|
||||
const imageUrl = URL.createObjectURL(new Blob([res.imageBuffer], { type: 'image/jpeg' }));
|
||||
const imageUrl = URL.createObjectURL(new Blob([res.imageBuffer], { type: 'image/avif' }));
|
||||
this.setState(prevState => {
|
||||
console.log('Setting embedded product image for', articleNr);
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user