Class: Ea::Qea::Models::EaImage
- Defined in:
- lib/ea/qea/models/ea_image.rb
Overview
Raw-row model for t_image. EA stores pasted images as EMF
(Enhanced Metafile) blobs in this table.
type values observed in real QEAs:
- "ENHMetafile" — Enhanced Windows Metafile (most common)
- "Metafile" — Old-style WMF
- "Bitmap" — DIB / PNG bitmap
Constant Summary collapse
- COLUMN_MAP =
{ "ImageID" => :image_id }.freeze
Class Method Summary collapse
Instance Method Summary collapse
-
#bytes ⇒ String?
Raw image bytes.
-
#emf? ⇒ Boolean
True when this row holds an EMF blob.
-
#wmf? ⇒ Boolean
True when this row holds a WMF blob.
Methods inherited from BaseModel
from_db_row, #primary_key, #sort_position
Class Method Details
.column_map ⇒ Object
31 32 33 |
# File 'lib/ea/qea/models/ea_image.rb', line 31 def self.column_map COLUMN_MAP end |
.primary_key_column ⇒ Object
19 20 21 |
# File 'lib/ea/qea/models/ea_image.rb', line 19 def self.primary_key_column :image_id end |
.table_name ⇒ Object
23 24 25 |
# File 'lib/ea/qea/models/ea_image.rb', line 23 def self.table_name "t_image" end |
Instance Method Details
#bytes ⇒ String?
Raw image bytes. SQLite returns BLOB as ASCII-8BIT String.
47 48 49 |
# File 'lib/ea/qea/models/ea_image.rb', line 47 def bytes image end |
#emf? ⇒ Boolean
Returns true when this row holds an EMF blob.
36 37 38 |
# File 'lib/ea/qea/models/ea_image.rb', line 36 def emf? type&.casecmp?("ENHMetafile") end |
#wmf? ⇒ Boolean
Returns true when this row holds a WMF blob.
41 42 43 |
# File 'lib/ea/qea/models/ea_image.rb', line 41 def wmf? type&.casecmp?("Metafile") end |