Skip to content

vtf :jpg_to_vtf .I need some example #16

Description

@Agnes4m

I want to convert a jpg image into a vtf file, but I don't know where the problem is. The file is wrong

from srctools.vtf import VTF
import io
a = VTF(width=1024,height=1024)
with open('C:\\Users\\73580\\Desktop\\R.jpg','rb') as fi:
    img1 = fi.read()
img1 = io.BytesIO(img1)
a.save(file=img1)
with open('C:\\Users\\73580\\Desktop\\file.vtf','wb') as f:
    a.save(f)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions