Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saved image is gren #1

Closed
yoyoy opened this issue Sep 30, 2014 · 12 comments
Closed

Saved image is gren #1

yoyoy opened this issue Sep 30, 2014 · 12 comments

Comments

@yoyoy
Copy link

yoyoy commented Sep 30, 2014

Hello,
I try to use your ib with a large jpg file but the saved file is totally green (#008700) ...
do you have ane idea ?
thanks

@oliver-moran
Copy link
Collaborator

What kind of manipulation (if any?) did you try and do on the image before you saved it? Can you attach an example of an original image that causes this to happen?

Thanks.

@yoyoy
Copy link
Author

yoyoy commented Sep 30, 2014

yep
you can try this image
http://dropcanvas.com/7vbtj
for now no matter with other images...

@yoyoy
Copy link
Author

yoyoy commented Jan 5, 2015

hello
i've uploaded again an image that cause the problem
http://dropcanvas.com/jti5x
24bit 96ppp image

my code is quite simple
var monimgresize = new Jimp(targetFileUpload, function () {
this.resize(neww, newh).write(targetFileUpload); // save again
});
with neww and newh in scalled to the original (so 2000x1498)

if you have an idea you can save me ;)
thanks a lot

@yoyoy
Copy link
Author

yoyoy commented Jan 5, 2015

exifs datas of this image

<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.0-c061 64.140949, 2010/12/07-10:57:01        ">
   <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
      <rdf:Description rdf:about=""
            xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/">
         <xmpMM:DocumentID>8B4B99099444A7275B7EECED9F2E31FD</xmpMM:DocumentID>
         <xmpMM:InstanceID>8B4B99099444A7275B7EECED9F2E31FD</xmpMM:InstanceID>
      </rdf:Description>
      <rdf:Description rdf:about=""
            xmlns:dc="http://purl.org/dc/elements/1.1/">
         <dc:format>image/jpeg</dc:format>
      </rdf:Description>
      <rdf:Description rdf:about=""
            xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/">
         <photoshop:ColorMode>3</photoshop:ColorMode>
         <photoshop:ICCProfile>sRGB IEC61966-2.1</photoshop:ICCProfile>
      </rdf:Description>
      <rdf:Description rdf:about=""
            xmlns:tiff="http://ns.adobe.com/tiff/1.0/">
         <tiff:ImageWidth>1558</tiff:ImageWidth>
         <tiff:ImageLength>2079</tiff:ImageLength>
         <tiff:BitsPerSample>
            <rdf:Seq>
               <rdf:li>8</rdf:li>
               <rdf:li>8</rdf:li>
               <rdf:li>8</rdf:li>
            </rdf:Seq>
         </tiff:BitsPerSample>
         <tiff:PhotometricInterpretation>2</tiff:PhotometricInterpretation>
         <tiff:SamplesPerPixel>3</tiff:SamplesPerPixel>
         <tiff:XResolution>72/1</tiff:XResolution>
         <tiff:YResolution>72/1</tiff:YResolution>
         <tiff:ResolutionUnit>2</tiff:ResolutionUnit>
      </rdf:Description>
      <rdf:Description rdf:about=""
            xmlns:exif="http://ns.adobe.com/exif/1.0/">
         <exif:ExifVersion>0221</exif:ExifVersion>
         <exif:ColorSpace>1</exif:ColorSpace>
         <exif:PixelXDimension>1558</exif:PixelXDimension>
         <exif:PixelYDimension>2079</exif:PixelYDimension>
      </rdf:Description>
      <rdf:Description rdf:about=""
            xmlns:xmp="http://ns.adobe.com/xap/1.0/">
         <xmp:CreateDate>2015-01-05T18:28:42+01:00</xmp:CreateDate>
         <xmp:ModifyDate>2014-05-27T09:46:15+02:00</xmp:ModifyDate>
         <xmp:MetadataDate>2014-05-27T09:46:15+02:00</xmp:MetadataDate>
      </rdf:Description>
   </rdf:RDF>
</x:xmpmeta>





















<?xpacket end="w"?>

@yoyoy
Copy link
Author

yoyoy commented Jan 5, 2015

i've made another test
open in photoshop
modified the size
saved for the web
and the result is different... but always bugged
check here
http://dropcanvas.com/7mu2a

@charafsalmi
Copy link
Contributor

I confirm this issue with a simple jpeg image.

        var jimp = new Jimp(newFile, function() {
          this.scale(0.9);
          this.quality(100);
          this.write(newFile, function() {
            reply();
          })
        });

dinar_n_dirham_3
dinar_n_dirham_3

@yoyoy
Copy link
Author

yoyoy commented Jan 7, 2015

hi @charafsalmi
did you know another library to do that without installing imagemagik or other external tool ?
thanks

@yoyoy
Copy link
Author

yoyoy commented Jan 7, 2015

hi !
i've found the (fu****g) solution ...
just Math.round your size ....
no comment :'(

@charafsalmi
Copy link
Contributor

Nope. I don't know any other one.
What do you mean by "just Math.round your size .... ", could you give an example ?
Thanks.

charafsalmi added a commit to charafsalmi/jimp that referenced this issue Jan 8, 2015
@charafsalmi
Copy link
Contributor

i've did a pull request for this =)
#4

@yoyoy
Copy link
Author

yoyoy commented Jan 8, 2015

right ;)
so you understood ;)

oliver-moran added a commit that referenced this issue Jan 8, 2015
ensure pixel widths are integers when re-sizing - fixes: #1
@oliver-moran
Copy link
Collaborator

That's great, guys. Thanks so much for this. I've pulled the solution in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants