sile 0.15.12

Simon’s Improved Layout Engine
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
local Util = require "imagesize.util"

local MIME_TYPE = "image/x-photoshop"

-- Determine the size of a PhotoShop save-file (*.PSD)
local function size (stream, options)
    local buf = stream:read(26)
    if not buf or buf:len() ~= 26 then
        return nil, nil, "PSD image header incomplete"
    end

    return Util.get_uint32_be(buf, 19), Util.get_uint32_be(buf, 15), MIME_TYPE
end

return size
-- vi:ts=4 sw=4 expandtab