Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions data/cameras.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17420,6 +17420,16 @@
<Sensor black="256" white="62914"/>
<Aliases>
<Alias id="CFV-50c">Hasselblad CFV-50c</Alias>
<Alias id="CFV-50c/Flash Sync">CFV-50c/Flash Sync</Alias>
<Alias id="CFV-50c/SWC">CFV-50c/SWC</Alias>
<Alias id="CFV-50c/200">CFV-50c/200</Alias>
<Alias id="CFV-50c/500">CFV-50c/500</Alias>
<Alias id="CFV-50c/Schneider">CFV-50c/Schneider</Alias>
<Alias id="CFV-50c/LensCtrl S">CFV-50c/LensCtrl S</Alias>
<Alias id="CFV-50c/Winder CW">CFV-50c/Winder CW</Alias>
<Alias id="CFV-50c/ELD">CFV-50c/ELD</Alias>
<Alias id="CFV-50c/ELX">CFV-50c/ELX</Alias>
<Alias id="CFV-50c/Pinhole">CFV-50c/Pinhole</Alias>
</Aliases>
<ColorMatrices>
<ColorMatrix planes="3">
Expand Down
4 changes: 2 additions & 2 deletions data/cameras.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@
</xs:simpleType>
<xs:simpleType name="AliasTypeIdType">
<xs:restriction base="xs:string">
<xs:pattern value="[a-zA-Z0-9 \-]{7,21}"/>
<xs:pattern value="[a-zA-Z0-9 \-/]{7,21}"/>
<xs:minLength value="7"/>
<xs:maxLength value="21"/>
</xs:restriction>
Expand All @@ -306,7 +306,7 @@
</xs:complexType>
<xs:complexType name="AliasesType">
<xs:sequence>
<xs:element type="AliasType" name="Alias" minOccurs="1" maxOccurs="9"/>
<xs:element type="AliasType" name="Alias" minOccurs="1" maxOccurs="11"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="HintTypeNameType">
Expand Down
2 changes: 2 additions & 0 deletions src/librawspeed/decompressors/AbstractLJpegDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ void AbstractLJpegDecoder::decodeSOI() {
ThrowRDE("Did not find SOF marker before SOS.");
parseSOS(data);
FoundMarkers.SOS = true;
if (erratumImplicitEOIMarkerAfterScan())
return;
break;
case JpegMarker::DQT:
ThrowRDE("Not a valid RAW file.");
Expand Down
7 changes: 7 additions & 0 deletions src/librawspeed/decompressors/AbstractLJpegDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ class AbstractLJpegDecoder : public AbstractDecompressor {
bool fixDng16Bug = false; // DNG v1.0.x compatibility
bool fullDecodeHT = true; // FullDecode Huffman

// Certain non-standard-complaint LJpeg's (old Hasselblad cameras) might not
// end with an EOI marker. This erratum considers an implicit EOI marker
// to be present after the (first) full Scan.
[[nodiscard]] virtual bool erratumImplicitEOIMarkerAfterScan() const {
return false;
}

void decodeSOI();
void parseSOF(ByteStream data, SOFInfo* i);
void parseSOS(ByteStream data);
Expand Down
6 changes: 6 additions & 0 deletions src/librawspeed/decompressors/HasselbladLJpegDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ class ByteStream;
class RawImage;

class HasselbladLJpegDecoder final : public AbstractLJpegDecoder {
// Old Hasselblad cameras don't end their LJpeg stream with an EOI.
// After fully decoding (first) Scan, just stop.
[[nodiscard]] bool erratumImplicitEOIMarkerAfterScan() const final {
return true;
}

[[nodiscard]] ByteStream::size_type decodeScan() override;

public:
Expand Down