Ever since VAST V 3.0 (circa 1996 ish) we have had a framework on our website for download that shows how to display an image in a window and have it resize as the window resizes.
-- Recently, I have dragged this out to use for one of my Seaside websites - Local modellers make scale plastic models and I provide the website to show these. To help me add details of the models, I have a little utility that loops through the list of images in a file, lets me add a description and saves an object in my database that provides the hooks for the web site. I am finding that most of my JPEG images won't display using the standard JPG loader. The loader opens the file but the offers a nil return. I know nothing about the structure of a JPEG so cannot debug this. Can anyone help me with this problem. One of the problem files is attached. Can anyone help me get this to display in VA? You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To view this discussion on the web visit https://groups.google.com/d/msgid/va-smalltalk/dea7e4a3-b552-4848-9f20-e410a5694dba%40googlegroups.com.
David
Totally Objects Doing Smalltalk since 1989 |
Greetings David,
-- I just tried the following with 9.2 and 8.5.1 and it seemed to load up the file and answer a valid CgDeviceIndependentImage (4727x4548 depth-24) CgJPEGFileFormat new loadFromFile: '032020006.jpg'. It's possible there was a conversion done when you pasted it in google groups? Maybe download the file you attached here and try it again with my snippet above - Seth On Friday, March 6, 2020 at 12:59:18 PM UTC-5, Totally Objects wrote:
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To view this discussion on the web visit https://groups.google.com/d/msgid/va-smalltalk/41a1c6c9-a4c8-433d-88d0-6c0115f64991%40googlegroups.com. |
It would appear that you are right - I can load the file when I download it but not directly from the original photo. I would put up a zip file so that no conversion can take place but the forum server rejects it. I have used resize utilities to both resize the file and to convert to a PNG and both of these fail as well. Can you suggest another way that I can get the file too you?
-- David On Friday, March 6, 2020 at 6:22:16 PM UTC, Seth Berman wrote:
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To view this discussion on the web visit https://groups.google.com/d/msgid/va-smalltalk/590b0af2-8190-4526-8588-8e54589a970a%40googlegroups.com.
David
Totally Objects Doing Smalltalk since 1989 |
You can use https://send-anywhere.com/ or https://wetransfer.com and share the link. Regards! Esteban A. Maringolo On Fri, Mar 6, 2020 at 4:27 PM Totally Objects <[hidden email]> wrote:
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To view this discussion on the web visit https://groups.google.com/d/msgid/va-smalltalk/CAJMgPCJeS6%2Bfn-zkxtceSZpqW9XvfMEpn_BPRC4Hp1Eqq_ceGA%40mail.gmail.com. |
In reply to this post by Long Haired David
Could it be a 32-bit image? I suspect that isn't supported. See CgJPEGFileFormat>>#convertImageToYCbCr:. We had experienced similar with CgWinBMPFileFormat>>#loadInfoHeader:.
-- You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To view this discussion on the web visit https://groups.google.com/d/msgid/va-smalltalk/70cd19c5-7e8e-4ef9-b02f-4bea7049ddd7%40googlegroups.com. |
On Friday, March 6, 2020 at 8:53:24 PM UTC, Wayne Johnston wrote:
Can you explain a bit more. When I use CgJPEGFileFormat new loadFromFile: the method returns nil so I have nothing to send to your suggested image. David You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To view this discussion on the web visit https://groups.google.com/d/msgid/va-smalltalk/8d3837fd-620a-46b7-9cca-0c655d9f2f22%40googlegroups.com.
David
Totally Objects Doing Smalltalk since 1989 |
In reply to this post by Seth Berman
I tried to upload a zip file but Google wouldn't let me so I have used a transfer web site. Can you download the following
-- https://we.tl/t-iKhK93kWDo That is a zip file so it should be the same as the file that I am handling. Thanks for your help Seth. David On Friday, March 6, 2020 at 6:22:16 PM UTC, Seth Berman wrote:
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To view this discussion on the web visit https://groups.google.com/d/msgid/va-smalltalk/5a1f38a6-762c-4ff6-ad1e-9de5c661b1e0%40googlegroups.com.
David
Totally Objects Doing Smalltalk since 1989 |
Hi David,
-- Glad to help. The issue is that progressive JPG is not supported in the product. For those that don't know, this is the ability for the image to "progressively" become clearer as it loads. We've probably all seen this when looking at map data online and zooming in and out. You don't see blank or black squares while the image loads, instead it gets clearer and clearer while it loads. Interestingly enough, we do support interlaced PNG as of 9.2 which is doing the same type of thing. And you will see in CgPNGFileFormat that there is an #interlacedFrameHandler: block you can supply so you can get notifications as each interlaced frame embedded in the PNG loads. - Seth On Saturday, March 7, 2020 at 6:17:43 AM UTC-5, Totally Objects wrote:
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To view this discussion on the web visit https://groups.google.com/d/msgid/va-smalltalk/21a23565-1126-4115-a7a7-8e7c91a573e2%40googlegroups.com. |
In reply to this post by Seth Berman
I have downloaded a program called IrFanView which as an option called JPG Lossless Operations. Using this, I now have a set of JPEGs that will load quite happily in 9.2.
-- Just as a small question - how come PNGs can do it but not JPEGS (which are more prevalent, I should think). However, as an aside, I am sure that I tried PNGs but that's for another day. David Totally Objects On Friday, March 6, 2020 at 6:22:16 PM UTC, Seth Berman wrote:
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To view this discussion on the web visit https://groups.google.com/d/msgid/va-smalltalk/6b0f8342-8e4a-4048-8ff1-fe90b3f373eb%40googlegroups.com.
David
Totally Objects Doing Smalltalk since 1989 |
Hi David,
-- Both PNG and JPEG are used quite extensively for their various advantages/disadvantages such as lossy vs lossless compression or overall size. I think each one is more prevalent in certain domains. In any case, many enhancements we do sort of organically appear with opportunity. In this case, we were already speeding up PNG by 20x as a precursor for changing our stock icons for the product. We took a quick look and decided interlaced frame support was easy enough to implement and could make it into our busy schedules. If we hear of enough customer demand for progressive jpeg (I see nothing in our historical database...so if they do care, they are not telling us about it) or we see similar opportunities like the one above...I can easily imagine it would be implemented. - Seth On Saturday, March 7, 2020 at 2:40:58 PM UTC-5, Totally Objects wrote:
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To view this discussion on the web visit https://groups.google.com/d/msgid/va-smalltalk/e07c98fa-5b3b-4e1f-9f78-9085b744597e%40googlegroups.com. |
In reply to this post by Long Haired David
FWIW, we call a shell script from VA that uses ImageMagick (and GhostScript) to manipulate jpg, gif and pdf files. Basically just for creating thumbnails and previews. We have a requirement to do that from the image without the need for writing the files to disk first. For Pharo there is http://smalltalkhub.com/#!/~StefanReichhart/Smagick/, but never got to try it. Cheers, Adriaan. You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To view this discussion on the web visit https://groups.google.com/d/msgid/va-smalltalk/399fa918-019c-4c93-947d-c1580699ca5b%40googlegroups.com. |
When we worked on Sophie 15 years we realized that all windows machine had iTunes installed as a music player. But as a side effect that had Apple’s QuickTime DLL which had full support for reading graphic files and making bitmaps. Can you say album covers... just needed some dll calls. Can’t say what the state of that would be today.. .... Sent from ProtonMail Mobile
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To view this discussion on the web visit https://groups.google.com/d/msgid/va-smalltalk/L-pMWyPFgK3r0SpqqcpPhIz593Unex4b0F0N_Ifx3htqMGscqgkGt_8QvU-okL8JoQXjibf4xQ-fQDP9WmDqreOvUGViCPUSek-Q-xNcw3Y%3D%40smalltalkconsulting.com. |
In reply to this post by Seth Berman
I didn't get any better response with PNG so maybe I did something wrong. It would be a bit of a task to move to using them rather than JPEG but it is a thin line between how I got this to work - and thus doing it every month - or move 1,000s of images to PNG. I guess I will carry on - grin.
-- Thanks for the help Seth. As usual you were very quick to help. David On Saturday, March 7, 2020 at 8:43:26 PM UTC, Seth Berman wrote:
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To view this discussion on the web visit https://groups.google.com/d/msgid/va-smalltalk/0605be52-295a-4b15-b416-e2c053f9fa3a%40googlegroups.com.
David
Totally Objects Doing Smalltalk since 1989 |
Hi David, My pleasure to help - Seth On Sun, Mar 8, 2020 at 5:55 PM Totally Objects <[hidden email]> wrote:
----------------------------------------------------- Seth Berman President & CEO, Instantiations Inc. Email: [hidden email] Twitter: @sethloco78 LinkedIn: www.linkedin.com/in/seth-berman You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To view this discussion on the web visit https://groups.google.com/d/msgid/va-smalltalk/CAO3JmgMhtV6C9nj3AdiRXbNDKBFCogePaag2tsKfBq16xwggwA%40mail.gmail.com. |
In reply to this post by Long Haired David
I remember doing something about this a few years ago... Try this:
-- Create a new class inheriting from CgJPEGFileFormat and Implement the following class method: formatMatchesByteStream: byteStream "Answer true if the input specified by the CgByteStream byteStream matches the receiver's format. Answer false if the file does not match the receiver's format. The input is read starting at the given 0-based offset. NOTE - Always seek back to original position of the byteStream." | soi appn originalPosition noMatch | originalPosition := byteStream position. noMatch := [byteStream lseek: originalPosition whence: SEEKSET. ^false]. (soi := CgJPEGStartOfImage fromStream: byteStream) verify ifFalse: noMatch. appn := CgJPEGAppn fromStream: byteStream. (appn verify and: [appn segmentMarker == APP0 or: [appn segmentMarker = 65505]]) "<<==== here is the difference" ifFalse: noMatch. byteStream lseek: originalPosition whence: SEEKSET. ^true Sorry, I couldn't test it but I hope it will work. If it doesn't, I find it interesting to take a look at freeimage.dll (in this case, I can help more because I started using this library instead of the native classes due to the modification in the jfif header for orientation of portrait / landscape photos from cell phones) . Good luck! Edmilson Bringel On Friday, March 6, 2020 at 2:59:18 PM UTC-3, Totally Objects wrote:
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To view this discussion on the web visit https://groups.google.com/d/msgid/va-smalltalk/a0db6b3f-ec6f-4788-95b6-e4592583ba76%40googlegroups.com. |
In reply to this post by Long Haired David
A few years ago I needed to change my applications due to the modification in the JFIF header to orient the portrait / landscape photos coming from cell phones and other things, so I started using freeimage.dll ...Today, I downloaded your photo and tested it successfully! Take a look at MSKFreeImageWrapper, too ... but, I needed to make some extensions to work completely ... if you need to, I can help, including exporting classes and extensions.
-- Regards. On Friday, March 6, 2020 at 2:59:18 PM UTC-3, Totally Objects wrote:
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To view this discussion on the web visit https://groups.google.com/d/msgid/va-smalltalk/87c25bc6-0b6b-4a81-9b13-e87ef4a14aaa%40googlegroups.com. |
Free forum by Nabble | Edit this page |