'whether keep previous format after convert the image to webp

my question is not about how to convert other formats to webp, instead what i want to ask is should i keep the original file with its original format and store the new generated file with .webp format in somewhere else or should i delete the old format instead. my code that converts the format is this:

[$name,] = explode('.',$this->getAddress());

    Image::make($this->getRawFile())->encode('webp', 90)

        ->save(self::PATH . "/" . $this->getFolderName() . "/" . $this->getDateYear() . "/" . $this->getDateMonth() .'/'.$name . '.webp');
    return $this;


Solution 1:[1]

I have noticed that using if/else in that way causes strange behavior. Refactor Tab2 as shown below and it should work as expected.

struct Tab2: View {
@State var isRed: Bool = false

var body: some View {
    ZStack {
        Color.red
        Color.green
            .opacity(isRed ? 0 : 1)
    }
    .onTapGesture {
        isRed.toggle()
    }
}

}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 David B.