Skip to content
This repository has been archived by the owner on Nov 19, 2018. It is now read-only.

Setup fails with error on converting psd files #12

Closed
yogoo opened this issue Jan 17, 2015 · 17 comments
Closed

Setup fails with error on converting psd files #12

yogoo opened this issue Jan 17, 2015 · 17 comments

Comments

@yogoo
Copy link

yogoo commented Jan 17, 2015

Frameit returns an error during setup when it tries to convert the devices frames Photoshop files. Below is a dump of the error.

 Converting PSD file '~/.frameit/devices_frames/iPhone 5c/Blue/iPhone_5c_Horz_Blu_sRGB.psd'
/Library/Ruby/Gems/2.0.0/gems/mini_magick-3.8.1/lib/mini_magick/image.rb:441:in `run': Command ("identify -quiet -ping /var/folders/rz/6ndkt81d14q4vtx0cms979h40000gn/T/mini_magick20150117-5207-569mpj.psd") failed: {:status_code=>1, :output=>""} (MiniMagick::Error)
    from /Library/Ruby/Gems/2.0.0/gems/mini_magick-3.8.1/lib/mini_magick/image.rb:423:in `run_command'
    from /Library/Ruby/Gems/2.0.0/gems/mini_magick-3.8.1/lib/mini_magick/image.rb:194:in `valid?'
    from /Library/Ruby/Gems/2.0.0/gems/mini_magick-3.8.1/lib/mini_magick/image.rb:149:in `create'
    from /Library/Ruby/Gems/2.0.0/gems/mini_magick-3.8.1/lib/mini_magick/image.rb:49:in `read'
    from /Library/Ruby/Gems/2.0.0/gems/mini_magick-3.8.1/lib/mini_magick/image.rb:117:in `block in open'
    from /Library/Ruby/Gems/2.0.0/gems/mini_magick-3.8.1/lib/mini_magick/image.rb:116:in `open'
    from /Library/Ruby/Gems/2.0.0/gems/mini_magick-3.8.1/lib/mini_magick/image.rb:116:in `open'
    from /Library/Ruby/Gems/2.0.0/gems/frameit-0.2.0/lib/frameit/frame_converter.rb:61:in `block in convert_frames'
    from /Library/Ruby/Gems/2.0.0/gems/frameit-0.2.0/lib/frameit/frame_converter.rb:57:in `each'
    from /Library/Ruby/Gems/2.0.0/gems/frameit-0.2.0/lib/frameit/frame_converter.rb:57:in `convert_frames'
    from /Library/Ruby/Gems/2.0.0/gems/frameit-0.2.0/lib/frameit/editor.rb:23:in `initialize'
    from /Library/Ruby/Gems/2.0.0/gems/frameit-0.2.0/bin/frameit:39:in `new'
    from /Library/Ruby/Gems/2.0.0/gems/frameit-0.2.0/bin/frameit:39:in `block (2 levels) in <top (required)>'
    from /Library/Ruby/Gems/2.0.0/gems/commander-4.2.1/lib/commander/command.rb:180:in `call'
    from /Library/Ruby/Gems/2.0.0/gems/commander-4.2.1/lib/commander/command.rb:180:in `call'
    from /Library/Ruby/Gems/2.0.0/gems/commander-4.2.1/lib/commander/command.rb:155:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/commander-4.2.1/lib/commander/runner.rb:421:in `run_active_command'
    from /Library/Ruby/Gems/2.0.0/gems/commander-4.2.1/lib/commander/runner.rb:81:in `run!'
    from /Library/Ruby/Gems/2.0.0/gems/commander-4.2.1/lib/commander/delegates.rb:8:in `run!'
    from /Library/Ruby/Gems/2.0.0/gems/commander-4.2.1/lib/commander/import.rb:10:in `block in <top (required)>'
@KrauseFx
Copy link
Contributor

Looks like there is something wrong with your imagemagick installation. Try this stackoverflow answer which helps you reinstalling it.

@mschm
Copy link

mschm commented Jan 18, 2015

I'm experiencing the exact same issue. Reinstalled imagemagick 6.9.0-3 with brew but the problem remains. Also reinstalled from source, as pointed out in the stackoverflow answer, but still no luck. Converting PSDs to JPG with imagemagick works fine.

@KrauseFx
Copy link
Contributor

This is all frameit does: frame_converter.rb:61

Maybe the Ruby gem does not find your imagemagick installation and uses a wrong (or broken) one? Have you had a previous installation?

@yogoo
Copy link
Author

yogoo commented Jan 19, 2015

Same as mschm.

Running identify on a known existing file works perfectly. So ImageMagick seems to work properly. The issue is with whatever happens when calling MiniMagick::Image.open(psd). The temporary file it tries to access doesn't seem to exist. I posted the issue at the minimagick repo (issue #283).

@KrauseFx
Copy link
Contributor

Have you checked if the psd on the given path is not broken?

@yogoo
Copy link
Author

yogoo commented Jan 19, 2015

Didn't think of this. No it's not broken... Also convert and mogrify convert it [to png] without a hitch.

@yogoo
Copy link
Author

yogoo commented Jan 19, 2015

The devs at MiniMagick offered a workaround:

MiniMagick.configure do |config|
    config.validate_on_create = false
end

I tried it in an irb session with the conversion you do in frame_converter.rb:61 and it works without errors. I wouldn't be able to write a pull request for it though as I don't develop under ruby.

@KrauseFx
Copy link
Contributor

Thanks @yogoo, I pushed a fix. Please download the latest version as ZIP from GitHub and run sudo bundle install and sudo rake install to test it.

Please let me know if that fixes your problem and I'll publish a new version.

@yogoo
Copy link
Author

yogoo commented Jan 19, 2015

How great it is when everything works as expected ^_^ Thanks!

@KrauseFx
Copy link
Contributor

Great to hear! Have you tried running it for your screenshots already? Does it work as expected?

@yogoo
Copy link
Author

yogoo commented Jan 19, 2015

Yes, it frames everything nicely.

There are two glitches:

  • With some templates, the size of the framed screenshot doesn't match the size of the "screen" on Apple's templates. This creates a gray line on one or multiple sides of the screenshots. In the case of the iPhone 6 Plus, in Apple's psd file the screen has a size of 540x961px. The screenshot is resized to 539x958px. I guess you could resize to 540x962 and adjust the offset to cover the entire gray area from the psd.
  • Photoshop can't open the framed files (Error: Could not complete your request because the file-format module cannot parse the file.). Sketch opens them without issues. But Photoshop opens the converted templates files...odd.

@KrauseFx
Copy link
Contributor

The converted files are png-files, generated by frameit, they must be valid ;)

Could you upload one of the screenshots with frames where you can see the glitch? I'd like to take a closer look.

@yogoo
Copy link
Author

yogoo commented Jan 19, 2015

Yeah, I know, that's why it's so confusing that Photoshop refuses to open some of them. Try opening the attached files in it. I'm curious to know if it works on your machine.

Yep, attached, I framed a 100% black screenshot to make the default more apparent. See these gray lines?
en-us-iphone5
en-us-iphone6
en-us-iphone6plus

@KrauseFx
Copy link
Contributor

Thanks, I created a separate issue for that: #13
Please subscribe there, so we can discuss it further.

The original issue seems to be resolved now 👍 Thanks for your help

@mschm
Copy link

mschm commented Jan 20, 2015

Great job! Works perfectly now

@KrauseFx
Copy link
Contributor

Great to hear 👍

@fastlanebot
Copy link

This issue was migrated to fastlane/fastlane#2781. Please post all further comments there.

fastlane is now a mono repo, you can read more about the change in our blog post. All tools are now available in the fastlane main repo 🚀

@fastlane-old fastlane-old locked and limited conversation to collaborators Mar 11, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants