Skip to content

expand only expands if both dimensions are larger than original #2

@jacobweber

Description

@jacobweber

If you use -expand, you have to specify that both dimensions are 2px larger than the largest dimension of the original 9-patch image. For example, if the original is 642x962, running -expand 650x1000 will give an error:

$ 9pedit -expand 650x1000 -out out splash.9.png
Will save images to out
--> Processing file splash.9.png
  - Image is 642x962 pixels
  + Expand 9-patch to 650x1000
Exception in thread "main" java.lang.IllegalArgumentException: Attempt to expand image by a negative amount
    at net.rcode.npedit.NinePatchImage.expand(NinePatchImage.java:169)
    at net.rcode.npedit.ExpandEditCommand.performEdit(ExpandEditCommand.java:23)
    at net.rcode.npedit.NinePatchEdit.applyCommand(NinePatchEdit.java:161)
    at net.rcode.npedit.NinePatchEdit.processFile(NinePatchEdit.java:144)
    at net.rcode.npedit.NinePatchEdit.processFiles(NinePatchEdit.java:166)
    at net.rcode.npedit.NinePatchEdit.main(NinePatchEdit.java:175)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions