Re: PelEntryTime unix time vs. ascii
Andre M. Winter - Carto.net [EMAIL PROTECTED] writes: hi, i am wondering why PEL makes use of unix time stamps (only?) for time related exif fields. using classical conversion methods limits (depending on the OS) input to a specific year range (eg. 1970-2036) whereas pure ascii (.mm-dd hh:mm:ss) would allow a broader range. (btw the specific fields in the exif spec are ascii, 20 chars). is there a way to do new PelEntryAscii(PelTag::DATE_TIME_ORIGINAL,$myDateTimeOriginal); Nope, but you have a good point there! The reason for converting the timestamps to Unix timestamps is simply that these are what all the other PHP functions deal with. But you're right, PEL shouldn't be limited to those. Thanks for all your good ideas! I've created feature request #1428467 to keep track of this one. -- Martin Geisler GnuPG Key: 0x7E45DD38 PHP Exif Library | PHP Weather | PHP Shell http://pel.sf.net/| http://phpweather.net/ | http://mgeisler.net/ Read/write Exif data | Show current weather| A shell in a browser pgpbTF4YcpH3A.pgp Description: PGP signature
Re: adding IFD GPS
Andre M. Winter - Carto.net [EMAIL PROTECTED] writes: A slight problem with this is that the floating point value has to be converted to a rational value since that is what is used in the Exif data. So your example becomes 476871293122 / 10 but those numbers are too big for 32-bit signed integers. yes, i saw that. there must be methods to overcome this here. take a look at this geo-tagged photograph: GPSLatitude: 47/1 20/1 59374/1009 GPSLongitiude: 8/1 20/1 66921/2500 Right, I sorry I confusing myself and you before: the GPSLongitude entry consists of three rationals indicating the degrees, minutes, and seconds. Each rational is expressed as two integers, just as you see it in the output from exiftool. So with three Exif rationals available (32 bit signed integers as both numerator and denominator) I think you'll find all the accuracy you'll ever want. and the seconds ratio seems to be the trick here. i looked intp the exif spec and this seems to be allowed... as i don't know how this is handled, i asked the author of the photos. they are tagged with the perl based exiftool (http://www.sno.phy.queensu.ca/~phil/exiftool/). maybe it is worth having a look in there. Definitely! I've stumbled upon this program before and from reading the homepage it seems much more complete and ambitious than PEL. Which is probably good since there should be lots of things PEL can benifit from. The homepage says that exiftool is licensed under the same license as Perl... looking up the Perl license tells us that Perl is licensed under either the GNU GPL or the Artistic License. So we should be allowed to incorporate code from exiftool into PEL. -- Martin Geisler GnuPG Key: 0x7E45DD38 PHP Exif Library | PHP Weather | PHP Shell http://pel.sf.net/| http://phpweather.net/ | http://mgeisler.net/ Read/write Exif data | Show current weather| A shell in a browser pgpcsqdPYzhQG.pgp Description: PGP signature
Re: Pel minimal version
TinyWebGallery [EMAIL PROTECTED] writes: Hi Michael, I would appreciate it if you could follow up to the PEL development list too so that the messages can be archived. Go to https://lists.sourceforge.net/lists/listinfo/pel-devel to subscribe. I have a nice webgallery (www.tinywebgallery.com) and want to integrate pel to my application because I want to keep the exif info if someone uploads images and select my resize option. Right now the exif data is lost. Good idea -- having a simple resize_and_keep_my_exif_data() function would be a nice feature (probably with a shorter name, though...) Do you have a minimal version where I simply read about 8 tags from the exif data and write it to the new file again? No, there is no such thing right now. But the core of PEL isn't that big anyway: I just downloaded PEL 0.9 and after removing the doc, test, po, locale, and examples directories I ended up with 644 KiB of uncompressed code. Zipping that up gives me 123 KiB. Going for bzip2 is even better: just 71 KiB. I saw your zip download is 1.8 MiB, so is 123 KiB really that much of a problem? Since you know which tags you want you could even trim the content of the files. Simply removing all comments, squizzing multiple blank lines into one, and removing INSTALL, NEWS, etc. gets the zip file down to just 41 KiB. Its for jpgs only. I want to keep my download as small as possible (its too big already :() I don't know how big a role that plays today, but 1.8 MiB sounds like a lot of a gallery that calls itself tiny :-) But I'm sure that it has lots of features and they come at a price. Thanks, Michael -- Martin Geisler GnuPG Key: 0x7E45DD38 PHP Exif Library | PHP Weather | PHP Shell http://pel.sf.net/| http://phpweather.net/ | http://mgeisler.net/ Read/write Exif data | Show current weather| A shell in a browser --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ PEL-devel mailing list PEL-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pel-devel
Re: pel and php 5.0.3
On 16 maj 2006, [EMAIL PROTECTED] wrote: Hi Michael I haven't left yet for my trip to Switzerland, so I can just answer this one... I don't get pel to work with php 5.0.3 - I always get a result file of 0kb I tried with 5.1.1 too and and then some duplicate constants where found. I removed them and then at least I go an output image. Does anyone know about a restriction of 5.0.3? I believe there has been some trouble with the different 5.x versions of PHP -- I'm not sure if this is the fault of PEL or what. But I would recommend that you upgrade to version 5.1 if you have the chance. -- Martin Geisler GnuPG Key: 0x7E45DD38 PHP Exif Library | PHP Weather | PHP Shell http://pel.sf.net/| http://phpweather.net/ | http://mgeisler.net/ Read/write Exif data | Show current weather| A shell in a browser pgpWV18d6n2kn.pgp Description: PGP signature
Kill off large tag descriptions?
Hi again, I would like to hear if anybody uses the large descriptions in PelTag of the individual tags? I don't like them and I'm thinking of dropping them because: * They are more or less verbatim copies from the Exif specification, so I guess it is a violation of their copyright to include them. * They refer to examples, tables, and figures from the Exif specification which means that some of the descriptions doesn't make much sense by themselves. * They're marked as translatable, but I don't expect anybody to ever work all the way through them. * They are somewhat large. I just trimmed the file down to 45 KiB from 111 KiB. To that one should add the savings from the smaller .po files and API docs. Any arguments for or against? -- Martin Geisler --- [EMAIL PROTECTED] --- http://mgeisler.net Read, write, create Exif data in PHP with PEL: http://pel.sf.net Take control of your webserver with PHP Shell: http://phpshell.sf.net pgpJOT11qW89q.pgp Description: PGP signature - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ PEL-devel mailing list PEL-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pel-devel
Re: [PEL] PelIfd.setThumbnail (PelDataWindow $d) doesn't work!
Pham Hoai Van [EMAIL PROTECTED] writes: Hi! First, I wanna say thank you to the founders of this very nice open source PEL. Thanks, I appreciate it! Second, I have a problem regarding setThumbnail img and need your helps. Here is my code: //-- //create thumbnail img $img = imagecreatefromjpeg(./I1.JPG); $thumb = create_thumbnail_image($img, 0.1); //create a thumbnail //image with size = 10% of its org //insert new thumbnail to img $jpeg = new PelJpeg(); $jpeg-loadFile(./I1.JPG); Just a hint: you can now simply do $jpeg = new PelJpeg(./I1.JPG); and PEL will load the data from the file. $exif = $jpeg-getExif(); $tiff = $exif-getTiff(); $ifd0 = $tiff-getIfd(); $ifd0-setThumbnail(new PelDataWindow($thumb)); $jpeg-setExif($exif); Another hint: this is not necessary (it does nothing in this case). When the $exif object is changed, then $jpeg will see the change as well since $jpeg has a reference (pointer) to $exif. Running above code, I got this exception: Fatal error: Uncaught exception 'PelDataWindowOffsetException' with message 'Offset -1 not within [0, 14]' in D:\Projects\MIP\WIP\Source\MIP-Server\lib\pel\PelDataWindow.php:243 Stack trace: #0 D:\Projects\MIP\WIP\Source\MIP-Server\lib\pel\PelDataWindow.php(303): PelDataWindow-validateOffset(-1) #1 D:\Projects\MIP\WIP\Source\MIP-Server\lib\pel\PelIfd.php(549): PelDataWindow-getByte(-1) #2 D:\Projects\MIP\WIP\Source\MIP-Server\web\thumb.php(17): PelIfd-setThumbnail(Object(PelDataWindow)) #3 {main} thrown in D:\Projects\MIP\WIP\Source\MIP-Server\lib\pel\PelDataWindow.php on line 243 This is due to a incorrect $thumb data is set to the PelDataWindow constructor. What kind of thumbnail data will I need to set to the PelDataWindow constructor? Any idea will be much appreciated. Thank you. The thumbnail data is supposed to be JPEG normal data, wrapped in a PelDataWindow. I assume your create_thumbnail_image() function return an Image resource like the ImageCreateFromJpeg() function? If so, then you need to extract the JPEG data from this resource. I've just committed some code that will let you do what you tried: construct a PelDataWindow from an image resource. So you can update From SVN and it should work. Or you can use this piece of code: ob_start(); ImageJpeg($thumb); $window = new PelDataWindow(ob_get_clean()); $window now has your data and you should be able to use it with the setThumbnail() method. As a side remark, then why do you want to update the thumbnail? The Exif standard indicates that the thumbnail should always be 160x120 pixels. You're not even allowed to rotate it which is kind of silly... Anyway, please let me know if the new code works as expected. -- Martin Geisler --- [EMAIL PROTECTED] --- http://mgeisler.net Read, write, create Exif data in PHP with PEL: http://pel.sf.net Take control of your webserver with PHP Shell: http://phpshell.sf.net pgpDVUTtEI3C9.pgp Description: PGP signature - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ PEL-devel mailing list PEL-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pel-devel
Re: Adding XP_TITLE and XP_COMMENT
Garrison Locke [EMAIL PROTECTED] writes: I believe the error is in the line above: the Windows fields must be created with the PelEntryWindowsString class and not just PelEntryUndefined. That should ensure that the string is encoded correctly. w00t! That totally fixed the problem. Thanks Martin!! That was the only change I needed to make and it worked perfectly. Cool, I'm glad to hear it! I've now updated PelTag.php to point to the PelEntryWindowsString class so that others can find it more easily in the future. Thanks again, No problem! -- Martin Geisler --- [EMAIL PROTECTED] --- http://mgeisler.net Read, write, create Exif data in PHP with PEL: http://pel.sf.net Take control of your webserver with PHP Shell: http://phpshell.sf.net pgp0nSEkMfeR2.pgp Description: PGP signature - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ PEL-devel mailing list PEL-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pel-devel
Re: What is the easy way to read and write GPS data?
Al Pro [EMAIL PROTECTED] writes: I've used example called pel_add_gpsinfo.php. I found it when I followed by one of links that you gave me. Ah, right... the example was modified and is now in the SVN repository. You can get a copy here: http://pel.svn.sf.net/viewvc/*checkout*/pel/trunk/examples/gps.php There is piece of code from this example, including function: $GPS_LONGITUDE = convertGps($GPS_LONGITUDE); //converting from decimal to conventional coordinate system $GPS_LATITUDE = convertGps($GPS_LATITUDE); function convertGps($gpsnumber) { [...] } I rewrote the convertGps function and called it convertDecimalToDMS instead. You'll find it in the gps.php file I linked above -- please try that one out instead. It has (so far...) given correct results for me :-) -- Martin Geisler pgpzTjYJ91COE.pgp Description: PGP signature - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/___ PEL-devel mailing list PEL-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pel-devel
Re: Using gps.php
Zoltan Bartalis [EMAIL PROTECTED] writes: Hi, Thanks for answering, Martin. My file is pretty simple: ?php include(pel/examples/gps.php); $input = '../rolls/2006420/00800.jpg'; $output = 'photos4panoramio/00800.jpg'; $description = 'A fancy description.'; $comment = 'A fancy comment.'; $model = 'A fancy camera.'; $latitude = 43.6596; $longitude = -65.3109; $altitude = 0.00; $date_time = '2003:12:18 14:58:05'; addGpsInfo($input, $output, $description, $comment, $model, $longitude, $latitude, $altitude, $date_time); ? Yeah, that is as simple as it can get... and it works for me, there's no syntax errors in your file. You might want to download the gps.php file again... other than that, I don't know where the problem would be :-( -- Martin Geisler Do your secure multi-party computations (SMPC) with VIFF, the Virtual Ideal Functionality Framework. Download at http://viff.dk/ pgp4Pof83cqbk.pgp Description: PGP signature - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/___ PEL-devel mailing list PEL-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pel-devel