人éã®è¨æ¶ã¨ããã®ã¯èå¼±ãªãã®ã§ãã©ããªã«è¼ãããæãåºãæãçµã¤ã¨èãã¦ãã£ã¦ãã¾ããä¸æ¹ã§ã©ãã§ããããã¨ãæå¤ã«è¦ãã¦ããããããã®ã ããã¤ã¾ã§ãè¦ãã¦ããè¨æ¶ã¨ããã§ãªãè¨æ¶ã®éãã¯ãå®æçã«æãåºãã¦ãã®è¨æ¶ãå¸ãæ§é ãä¸æ¸ããã¦ããããã©ããã§æ±ºã¾ãããããã§ã¯ã楽ããã£ãæãåºãå®æçã«æãåºãã«ã¯ã©ãããã°ããããåçã¢ã«ãã ãè¦è¿ãã®ãä¸çªã ãèªåã ãã§ãªãããã¼ããã¼ãåä¾éã«ãæ軽ã«è¦ã¦ã»ããã®ã§ããã°ãPCãã¹ãã¼ããã©ã³ãã¿ãã¬ãã端æ«ä¸ããWebãã©ã¦ã¶ã§ã¢ã¯ã»ã¹ã§ããããã«ãããã¨ããã ã
ããã§ãå¤æ°ã®ç»åãã¡ã¤ã«ãä¿åç¨ã«å å·¥ããããã®ã¹ã¯ãªããcram_iamge.pyã使ã£ã¦ãèªåã§åçã«ã¿ãã°ãä½æããããããã«ãã«ã¿ãã°é²è¦§ç¨ããã°ã©ã list_image.pyã使ã£ã¦ãWebãã©ã¦ã¶ã§é²è¦§ã§ããããã«ãããã
ãã¢
ãã¡ãã®デモサイトã«ã¢ã¯ã»ã¹ããããããã¹ã¯ã¼ãå
¥åç»é¢ã«ãªãã®ã§ããabcãã¨å
¥ãã¦éä¿¡ããããã°ã¤ã³ã«æåããã¨ãåçã®ãµã ãã¤ã«ãæ®å½±æ¥ã®éé ã«ä¸¦ã¹ããã¦è¡¨ç¤ºããããGoogle Photosã¨ä¼¼ã表示ã ããããã«ã¯ç§ã®ã³ãã¯ãªããããæ®å½±æ¥ãæ°ãããã®é ã«è¡¨ç¤ºãããã®ã ããåãæ®å½±æ¥ã®ä¸ã§ã¯å¤ãé ã«ä¸¦ã¹ããã¦ããã®ã ãéå»ã®åçãé²è¦§ããéã«ã¯ãã¾ãã©ããªæ¥ã ã£ãã®ãæãåºãã¦ããã®æ¥ã®æããæ©ã¾ã§ã®åçãå·¡ã£ã¦ãããã®ã ãæ¢ãããããã¢ã¯ã»ã¹é »åº¦ã®è¦³ç¹ããæ¥ä»ã¯æ°ããé ã«ä¸¦ã¹ãæ¹ã使ãããããã追ä½é¨ãéè¦ãããªãåæ¥ã®åçã¯å¤ãé ã®æ¹ãããã
ååçã®ãµã ãã¤ã«ãã¯ãªãã¯ããã°ããã®åçã®è¡¨ç¤ºç¨ç»åãè¦ããããããã¯å
ç»åã§ã¯ãªããã£ã¹ãã¬ã¤ã§ã®è¡¨ç¤ºç¨ã«æ大25ä¸ç»ç´ ã®JPEGã«ç¸®å°ããããã®ã§ãããåç»ã表示ã§ãããåçãåç»ã¯ãã£ã¹ãã¬ã¤ã®å¹
ãé«ãã«åããã大ããã§è¡¨ç¤ºãããããããã«åããã¦ããã«ç¸®å°è¡¨ç¤ºããã¦ããå ´åãç»åãã¯ãªãã¯ããã¨æ¡å¤§çãåãæ¿ãããã¨ãã§ãããç»é¢ä¸æ¹ã«ã¯EXIFã®ã¡ã¿ãã¼ã¿ã表示ãããããå
ç»åã«ã¢ã¯ã»ã¹ããããã®ãoriginalãã¨ãããªã³ã¯ããã£ãããããç»é¢å³è©ã«ãããã¼ã¸ããããã¿ã³ãæ¼ãã¨ããã®æ¥ã®æ¬¡ã®åçãåã®åçã«é·ç§»ãããã¨ãã§ããããã¼ãã¼ãã®å·¦å³ã®ç¢å°ãã¼ã§ãåå¾ã«ç§»åã§ããããaããæ¼ãã¨ãã«ã¹ã¯ãªã¼ã³è¡¨ç¤ºã«ãªãããescãã¾ãã¯ãqããæ¼ãã¨ããããã¼ã¸ã«æ»ãããzããæ¼ãã¨ãå
ãã¼ã¿ããã©ã¦ã¶ã§è¡¨ç¤ºå¯è½ãªå½¢å¼ã®å ´åã¯å
ãã¼ã¿ã表示ããåç»ã®å ´åã¯åç»ã®åçãè¡ãããxããæ¼ãã¨ç»åã®æ¡å¤§è¡¨ç¤ºåãæ¿ããè¡ãããmããæ¼ãã¨ã¡ã¿ãã¼ã¿ã®è¡¨ç¤ºåãæ¿ããè¡ãã
ãã¢ã®ããããã¼ã¸ã«æ»ã£ã¦ãä»åº¦ã¯æ¥ä»ã®é¨åãã¯ãªãã¯ããããããã®æ¥ä»ã®åçã®ã¿ãé²è¦§ãããã¨ãã§ãããæ大100æã®åçã®ãµã ãã¤ã«ãä¸ç»é¢ã«è¡¨ç¤ºãããã®ã ãããã以ä¸ã®ææ°ãããå ´åã«ã¯ç»é¢å³è©ã«ãã¼ã¸ããããã¿ã³ãç¾ãããããã§ãç§ã®ã³ãã¯ãªããããåãæ¥ä»å
ã«100æ以ä¸ã®åçããã£ã¦ããã®101æç®ä»¥éã®ãåã®å
å¼ããè¦ããå ´åã«ã¯ãâ»ããæ¼ãã°ããã次ã®æ¥ä»ã®ãèªåã®å
å¼ãã«é£ã³ããå ´åã«ã¯ããâ»â»ããæ¼ãã°è¯ããæ»ãå ´åãåãããã¼ãã¼ãã®ç¢å°ãã¼ãæ¼ããå ´åãåã®å
å¼ãããã°ããã表示ããããªããã°èªåã®å
å¼ã«é£ã¶ããã«ãªã£ã¦ãããã¤ã¾ãç¢å°ãã¼ã ãã§å
¨ã¦ã®åçãè¦ã¦ãããããªããä¸ãæ¼ãã¨ã親ãã«è¡ããä¸ãæ¼ãã¨ãé·åãã«è¡ãããã«ãªã£ã¦ããã
ããããã¼ã¸ã«è¡ãã¨ãå³è©ã«èãè²ã§å¤ãªè¨å·ã®ã¢ã¤ã³ã³ããããã¨ã«æ°ã¥ããããããªããã¡ãã¥ã¼ã¢ã¤ã³ã³ã ããããæ¼ãã¨ãç¹æ®ãªè¡¨ç¤ºæ¹æ³ãé¸ã¶ãã¨ãã§ããããããç§ã®ã³ãã¯ãªã®æ©è½ã ããFlatten Treeãã¯ãã³ã¬ã¯ã·ã§ã³ã®é層æ§é ãç¡è¦ãã¦ãããããå
¨ã¦ã®ã¬ã³ã¼ããåãã³ã¬ã¯ã·ã§ã³ã«å
¥ã£ã¦ãããã®ããã«è¡¨ç¤ºããããCollection Snippetsãã¯ãæ¥ä»ãã¨ã«æ大3æã®åçãã表示ãããªããããã®åããããã®æ¥ä»ã表示ãããã®ã§ãæ¥ä»ãç¹å®ãã¦ããå¤ãåçãé²è¦§ããéã«ä¾¿å©ã ããã£ã3æã§ãã®æ¥ã表ãå¿
è¦ãããã®ã§ã3æã¯ãã®æ¥ã®æãã3æã§ã¯ãªããé çªã§ä¸çåããã°ã«ã¼ãã®å
é ãæ¡ç¨ãããããã«ãªã£ã¦ããããCollection Namesãã¯åã«æ¥ä»ã®æååã ãã®ãªã¹ããåºãã®ã§ããã§ã«æ¥ä»ãããã£ã¦ããå ´åã«ã¯ããã使ãã¨è¯ãããNewest First Order Collectionsããã¯ãªãã¯ããã¨ãããã©ã«ãã§ãããæ¥ä»éã ãæ°ããé ãã¤æ¥ä»å
ã¯å¤ãé ã§è¡¨ç¤ºãããããNewest First Order Throughãã¯æ¥ä»éãæ¥ä»å
ãæ°ããé ã«ãªãããOldest First Order Throughãã¯å
¨ã¦ãå¤ãé ã«ãªãããMore Recordsããæ¼ãã¨ä¸ç»é¢ã®æ大表示æ°ã10åã«ãªãããLess Recordsãã¯10åã®1ã«ãªãã
ã¹ãã¼ããã©ã³ã®é
æ
®ããã¦ãããç»é¢å¹
ã1000ãã¯ã»ã«ãä¸åãã¨ãããã«æé©åããç»é¢é
ç½®ã«ãªããç»é¢ã®ã¹ã¯ã¤ãæä½ã§ã³ã³ãã³ãã®åå¾ç§»åãã§ãããã¾ããåå¾ã®ãã¼ã¸ã®è¡¨ç¤ºç»åãå
èªã¿ãã¦ãããã¨ã§è¡¨ç¤ºé
延ã®ä½æ¸ãå³ã£ã¦ãããã
éè¦ãªãã¤ã³ãã¨ãã¦ãGoogle Photosããã®ä»ããã¤ãã®ãµã¼ãã¹ã¨éã£ã¦ããµã ãã¤ã«ã®çææã«ICCãããã¡ã¤ã«ãå¥å¥ªããã ããããªãã¦ãã¼ã¿ãsRGBè²ç©ºéã«ã¡ããã¨å¤æãã¦ããã¨ããã®ãããããªã®ã§Adobe RGBçã§ç¾åããåçãåé¡ãªã表示ã§ããã
ã¤ã³ã¹ãã¼ã«
ï¼è¿½è¨ï¼æ¬ã½ããã¦ã§ã¢ã¯å¾ã«ãJakuzureãã¨ãã¦ããã±ã¼ã¸ãããã®ã§ããã¡ãã®èª¬æãããããã ãããï¼
åæã¨ãã¦ãããªãã¯å¤§éã®å¤æ°ã®ç»åãã¡ã¤ã«ãèªåã®ã¹ãã¬ã¼ã¸ä¸ã«ä¿ç®¡ãã¦ãããã®ã¨ãããåç»ãã¡ã¤ã«ããã£ã¦ãããããããã®ã«ã¿ãã°ãä½ã£ã¦ãWebãã©ã¦ã¶ãèªä½ã®ã¢ããªã±ã¼ã·ã§ã³ã½ããã¦ã§ã¢ã§æ軽ã«é²è¦§ã§ããããã«ããããç»åãã¡ã¤ã«ã®å½¢å¼ã¯JPEGãJPEG2000ãTIFFãPNGãGIFã¨ãããã¾ããMOVãMP4ã®åç»ãã¡ã¤ã«ããã£ã¦ãããã
ããªãã¯UNIXç³»ï¼MacOSãLinuxãå«ãï¼ãWindowsã®ã³ã³ãã¥ã¼ã¿ãæã£ã¦ãã¦ãããããç»åãã¡ã¤ã«ã®ã¹ãã¬ã¼ã¸ãèªã¿è¾¼ãããã®ã¨ãããã¾ãããã®ã³ã³ãã¥ã¼ã¿ä¸ã§Webãµã¼ããåä½ããããããã®ã¨ããã家ã§é²è¦§ããã ããããã°ãã®Webãµã¼ãã¯å¤é¨ã«å ¬éããã¦ããå¿ è¦ã¯ãªããLANå ããã¢ã¯ã»ã¹ã§ããã°ããããã¡ããã¤ã³ã¿ã¼ãããã«ç¹ãã£ã¦ããã°ä¸çä¸ã©ãããã§ãé²è¦§ã§ããç°å¢ãæ§ç¯ã§ããã
ããªãã®ã³ã³ãã¥ã¼ã¿ã«ã¯ãPythonï¼2ç³»ã§ã3ç³»ã§ãOKï¼ãImageMagickï¼6ç³»ã§ã7ç³»ã§ãOKï¼ãExifToolãã¤ã³ã¹ãã¼ã«ããã¦ãããã®ã¨ãããåç»ãã¡ã¤ã«ã®ãµã ãã¤ã«ãä½ãããå ´åã«ã¯avconvãå ¥ã£ã¦ããã¨è¯ããããªãã¦ãæ§ããªãã
ãã¨ã¯ãcram_image.pyã¨list_image.pyããã¦ã³ãã¼ããã¦ãå®è¡ãã¼ããã·ã§ã³ãã¤ãã¦ãã³ãã³ãæ¤ç´¢ãã¹ã®éã£ãé©å½ãªãã£ã¬ã¯ããªã«ç½®ãã°è¯ãã
$ chmod 755 cram_image.py list_image.py $ sudo cp cram_image.py list_image.py /usr/local/bin
åçã«ã¿ãã°
ä¿åããç»åãã¼ã¿ã¯ã§ããã ãé«ç»è³ªã§é«è§£å度ã®ãã®ãæã¾ããããããããã®ã¾ã¾é²è¦§ç°å¢ã«è»¢éããã®ã¯ç¾å®çã§ã¯ãªãã100MBã¨ã50MBã¨ãã®ãã¼ã¿ãæ¯å転éããã®ã¯æéãéããããããããããã«1600ä¸ç»ç´ ã¨ãã®è§£å度ã¯æ®éã®PCç¨ãã£ã¹ãã¬ã¤ã§è¦ãã«ãã¦ã解å度ãé«ãããããã¹ãã¼ããã©ã³ã§è¦ããªããªãããã ããããã£ã¦ãä¿åç¨ç»åããé²è¦§ç¨ç»åãçæãã¦ããã¦ãæ®æ®µã¯ãããé²è¦§ããã®ãæã¾ãããæ¡å¤§ãã¦ãã£ã¨è¯ãè¦ããã¨æã£ãå ´åã«ã ãä¿åç¨ç»åã«ã¢ã¯ã»ã¹ããã°ãããã¾ããããããã®åçã表示ããä¸è¦§ç»é¢ããåå¥ã®åçãé¸ã³ããã®ã§ãä¸è¦§ç»é¢ã«è¡¨ç¤ºããããµã ãã¤ã«ç»åãå¿ è¦ã ãããã«ãæ®å½±æ¥æãæ®å½±è¨å®ãªã©ã®ã¡ã¿ãã¼ã¿ãä¸ç·ã«è¡¨ç¤ºããããæ¥ä»ã«åºã¥ãã¦ãã©ã«ãåããã¦ç®¡çããããããã®ã§ãäºãEXIFçã®ã¡ã¿ãã¼ã¿ãæ½åºãããã¡ã¤ã«ãä½ã£ã¦ããããã
以ä¸ã®è¦æ±ãããåå ¥åç»åãã¡ã¤ã«ã«å¯¾ãã¦ããä¿åç¨ç»åãã¡ã¤ã«ãã表示ç¨ç»åãã¡ã¤ã«ãããµã ãã¤ã«ç»åãã¡ã¤ã«ããã¡ã¿ãã¼ã¿ãã¡ã¤ã«ãã®4ã¤ãçæãã¦é©å½ãªãã£ã¬ã¯ããªã«é ç½®ãããã®ãåçã«ã¿ãã°ã¨å¼ã¶ãã¨ã«ããããã©ã«ãã®ä¸ã«ã©ã®ããã«ãµããã£ã¬ã¯ããªãä½ã£ã¦æ´çãããã¯ã¦ã¼ã¶ã®èªç±ã ããã ãã4種é¡ã®ãã¡ã¤ã«ã¯åããã£ã¬ã¯ããªã®ä¸ã«ç½®ããã¨ã¨ããããã¡ã¤ã«åã®å é ãåãæååã§å§ã¾ããæ¥å°¾è¾ãããããã-data.*ãã-view.jpgãã-thumb.jpgãã-meta.tsvãã§çµãããã¡ã¤ã«ãä¸ã¤ã®ã¬ã³ã¼ãã¨ãã¦èªèãããä¿åç¨ç»åãã¡ã¤ã«ã¯å ã®å ¥åãã¡ã¤ã«ãã®ãã®ã§ãããæ¡å¼µåã¯ãã¼ã¿å½¢å¼ã«å¿ã㦠.jpgã.jp2ã.tifãªã©ã«ãªãã
å®ç¨çã«ã¯ãæ¥ä»ã§ãµããã£ã¬ã¯ããªãä½ãã®ãããããã§ãããå¹´ãæã§ãµããã£ã¬ã¯ããªãä½ãæµåãããããæ¥ä»ã§ååã ãåä¸ãã£ã¬ã¯ããªå ã®ã¨ã³ããªæ°ã¯ã100å¹´éæ®ãç¶ããã¨ãã¦ã35000åã«ãããªããªãã®ã§ãä»æ¥ã®OSã§ããã°å ¨ãåé¡ãªãè¦æ¨¡ã ã
ãã£ããã«ã¿ãã°ãä½ã£ã¦ã¿ããã ä¾ã¨ãã¦ãæ®ããããåçã®ç»åãã¼ã¿ã /home/john/photo_archive ã¨ãããã£ã¬ã¯ããªã«ä¿åãã¦ããã¨ãããããã®ä¸ã«ã¯JPEGã¨TIFFã¨JPEG 2000ã¨MOVã¨MP4ã®ç»åããã³åç»ã®ãã¡ã¤ã«ã大éã«å ¥ã£ã¦ãããã®ã¨ããããã®ã«ã¿ãã°æ§é ã /home/john/photo_album ã®ä¸ã«ä½ã£ã¦ãããã«æ®å½±ããæ¥ä»ã®ãµããã£ã¬ã¯ããªã«èªåçã«åé¡ãã¦ä¿åããã
$ mkdir /home/john/photo_album $ find /home/john/photo_archive -type f | egrep -i '\.(jpg|tif|jp2|mov|mp4)' | sort | cram_image.py --read_stdin --catalog --destination /home/john/photo_album \ --date_subdir --timestamp_name --unique_name --intact
findã³ãã³ãã®è¡ã¯ã-type fã§ãã¡ã¤ã«ã®ã¿ãåºåããããã®åºåãæ£è¦è¡¨ç¾ã«ããã¦æ¡å¼µåã .jpg 㨠.tif 㨠.mov 㨠.mp4 ã®ãã®ã ãã«éå®ãã¦ãè¾æ¸é ã§ä¸¦ã³æ¿ãã¦ãããcram_image.pyã®ãã©ã°ã説æããã--read_stdinã§æ¨æºå ¥åããå ¥åãã¡ã¤ã«ã®ãã¹ã®ãªã¹ããåãåãã--catalogã§ãä¸è¿°ã®4種é¡ã®ã«ã¿ãã°ãã¡ã¤ã«ãä½æãããã--destinationã§åºåå ã®ãã£ã¬ã¯ããªãæå®ããã--date_subdir ã§æ®å½±æ¥ã®ãµããã£ã¬ã¯ããªãä½ãã--timestamp_name ã§ä¿åãã¡ã¤ã«ã®ååãæ®å½±æ¥æã®ååã«ãããååãæ¥æã ãã ã¨åç§ã«æ®ã£ãåçãä¸æ¸ããããæããããã®ã§ã--uique_name ã§ã¦ãã¼ã¯ãªæ¥å°¾è¾ãã¤ãã¦éè¤ãåé¿ãã¦ããã--intactãã¤ããã¨ãå ¥åãã¡ã¤ã«ã®ç¸®å°ãå å·¥ãåå§ç¸®ãæå¶ãã¦ããã®ã¾ã¾ä¿åãããcram_image.py ã®è©³ãã使ãæ¹ã«ã¤ãã¦ã¯以前の記事ãåç §ã®ãã¨ã
çµæã¨ãã¦ããããªãããªãã¡ã¤ã«ãä½ãããã ãããããããã¯ãã ã®ãã¡ã¤ã«ãªã®ã§ãæ®éã«ãã¡ã¤ã«ããã¼ã¸ã£ã§ã¢ã¯ã»ã¹ãã¦éããã移åããããã§ããã
$ find /home/john/photo_album -type f /home/john/photo_album/2018-01-01/20180101092345-af0e2ire-data.mov /home/john/photo_album/2018-01-01/20180101092345-af0e2ire-meta.tsv /home/john/photo_album/2018-01-01/20180101092345-af0e2ire-thumb.jpg /home/john/photo_album/2018-01-01/20180101092345-af0e2ire-view.jpg /home/john/photo_album/2018-01-01/20180101131533-8whi4rex-data.jp2 /home/john/photo_album/2018-01-01/20180101131533-8whi4rex-meta.tsv /home/john/photo_album/2018-01-01/20180101131533-8whi4rex-thumb.jpg /home/john/photo_album/2018-01-01/20180101131533-8whi4rex-view.jpg ...
é²è¦§ç¨ãµã¼ãã¹ã®è¨ç½®
list_image.pyã¯ä¸è¿°ã®åçã«ã¿ãã°ãé²è¦§ããããã®ã³ãã³ãã©ã¤ã³ãã¼ã«ã§ããããã¤CGIã¹ã¯ãªããã§ããããã¾ãã¯ã³ãã³ãã¨ãã¦ä½¿ã£ã¦ã¿ããã
$ list_image.py --album_dir /home/john/photo_album /
ä¸è¨ã§ã¯ã--album_dir ã§ã«ã¿ãã°æ§é ã®ãããã¼ã¿ãã£ã¬ã¯ããªãæå®ãã¦ããã®ä¸ã®ã/ãã¨ãããªã½ã¼ã¹ãæ¤ç´¢ãã¦ããã以å¾ãã«ã¿ãã°æ§é ã®ãããã£ã¬ã¯ããªã¨ãã®ãã¼ã¿ãç·ç§°ãã¦ãã¢ã«ãã ãã¨å¼ã¶ãã¨ã«ãããã¢ã«ãã ã®ä¸ã«ã¯æ®å½±æ¥ã«åãããµããã£ã¬ã¯ããªãåå¨ãã¦ããããã ããã/ããæ¤ç´¢ããã¨ãããæ¥ä»ã®ãµããã£ã¬ã¯ããªãä¸è¦§ãããã¨ãã§ãããã¢ã«ãã å ã®ãªã½ã¼ã¹ç®¡çã®æèã§ã¯ããã£ã¬ã¯ããªããµããã£ã¬ã¯ããªã®ãã¨ããã³ã¬ã¯ã·ã§ã³ãã¨å¼ã³ãã³ã¬ã¯ã·ã§ã³å ã®å®ãã¼ã¿ã示ãã¨ã³ããªã®ãã¨ããã¬ã³ã¼ããã¨å¼ã¶ã ã³ã¬ã¯ã·ã§ã³ã¨ã¬ã³ã¼ãã®ç·ç§°ãããªã½ã¼ã¹ãã¨å¼ã¶ãå ¨ã¦ã®ãªã½ã¼ã¹ã«ã¯IDãã¤ãã¦ãã¦ãããã¯ã¢ã«ãã å ã®ç¸å¯¾ãã¹ã¨ä¸è´ããã®ã ããããã使ã£ã¦ãªã½ã¼ã¹ã®å 容ãåãåããããã¨ãã§ããã
{ "result": { "id": "/", "type": "collection", "collection_serial": 0, "num_child_records": 0, "num_child_collections": 16, "num_orphans": 0, "num_reachable_records": 0, "items": [ { "id": "/2017-08-01" }, { "id": "/2017-08-02" }, { "id": "/2017-08-04" }, { "id": "/2017-08-05" }, ... ], }, ... }
å¼æ°ã¨ãã¦ã/ãã§ã¯ãªãã/2017-08-01ããªã©ã¨æå®ããã¨ããã®ã³ã¬ã¯ã·ã§ã³ã®ä¸ã®ã¬ã³ã¼ããæ¢ãã¦ããããããã§æ示ãããã/2017-08-01/20170801123456ããªã©ã®ã¬ã³ã¼ãIDãæå®ããã¨ãã¬ã³ã¼ããæ§æãããã¡ã¤ã«ç¾¤ãç¥ããã¨ãã§ããã
$ list_image.py --album_dir /home/john/photo_album /2017-08-01/20170801120000 { "result": { "id": "/2017-08-01/20170801120000", "type": "record", "record_serial": 0, "data_url": "file:///home/john/photo_album/2017-08-01/20170801120000-data.jpg", "metadata_url": "file:///home/john/photo_album/2017-08-01/20170801120000-meta.tsv", "viewimage_url": "file:///home/john/photo_album/2017-08-01/20170801120000-view.jpg", "thumbnail_url": "file:///home/john/photo_album/2017-08-01/20170801120000-thumb.jpg" }, ... }
ãæ°ã¥ãã®ããã«ãåºåã¯JSONå½¢å¼ã§ãããJSONãã¼ã¿ãçºãã¦å¬ãã人ã¯ãããªã«ããªãã ããããããã§æ©æ¢°å¯èªæ§ã確ä¿ãã¦ãããã¨ã¯ã¤ã³ã¿ã¼ãªãã©ããªãã£ããªãã¡ç¸äºéç¨æ§ã®è¦³ç¹ã§é常ã«éè¦ã ã--output_format htmlã¨ãã¤ããã¨XHTML5æºæ ã®ãã¼ã¿ãåãã®ã ããããã¯åé ã«è¿°ã¹ããã¢ç»é¢ãæç»ãã¦ãããã¼ã¿ãã®ãã®ã§ããã
ãªãã·ã§ã³ã® --depth ã§æ·±åº¦ãæå®ããã¨ãæå®ãããªã½ã¼ã¹IDããå帰çã«æ·±ãåªå æ¢ç´¢ãè¡ã£ãçµæã表示ãã¦ãããã--depth=0 ã¨ãããã¨å ¨ã¦ã®åå«ã表示ãããããã®ã»ãã«ãç´°ããæ©è½ããããããããããã㯠--help ã§ç¢ºèªããããã
list_image.pyãCGIã¹ã¯ãªããã¨ãã¦å®è¡ããã¨ãåçé²è¦§ãå¯è½ã«ãªããWebãµã¼ãã®è¨å®ã¯ããã§ã¯å²æããããCGIãFastCGIãªã©ã®è¨å®ãé©å®è¡ã£ã¦ãlist_image.pyãå¼ã³åºãããã«ããã°ãããå ¸åçã«ã¯ãlist_image.py ãé©å½ãªå ´æã«ã³ãã¼ãã¦ãlist_image.cgiã¨ãããååã«ãããããã«ããããã¨ãã£ã¿ã§éãã¦ãåé ä»è¿ã«ãã以ä¸ã®è¨å®ãæ¸ãæããã
ALBUM_DIR = "/home/john/photo_album" # ã¢ã«ãã ãã£ã¬ã¯ããªã®çµ¶å¯¾ãã¹ URL_PREFIX = "https://example.com/photo_album" # ã¢ã«ãã ãã£ã¬ã¯ããªã®å ¬éURL
ã¢ã«ãã ãã£ã¬ã¯ããªã®ä¸ã®ãã¼ã¿ã¯ãWebãµã¼ãä¸ã®ãªã½ã¼ã¹ã¨ãã¦ç´æ¥å ¬éãããããã®ããã«ãã¢ã«ãã ãã£ã¬ã¯ããªèªä½ã®å ¬éURLãæå®ããå¿ è¦ããããããããã®ã¬ã³ã¼ãã«å±ãããã¡ã¤ã«ã¯ãã¢ã«ãã ãã£ã¬ã¯ããªã®å ¬éURLãåºæºã¨ããç¸å¯¾ãã¹ã¨ãã¦è§£éããããã¤ã³ã¿ã¼ãããä¸ã§éç¨ããå ´åã«ã¯ããªã½ã¼ã¹ã®ã»ãã¥ãªãã£ã¯Webãµã¼ãã®æ©è½ã§ç¢ºä¿ãããã¨ã«ãªãã
CGIã¹ã¯ãªããã /list_image ã¨ãã¦ã¢ã¯ã»ã¹ã§ããããã«ãããªãã°ã/list_image/hoge ã¨ããURLã¯ã/hogeãã¨ãããªã½ã¼ã¹ã«ã¢ã¯ã»ã¹ãããCGIã¹ã¯ãªãããã/foobar/list_image.cgiãã¨ãã¦è¨ç½®ããªããã/foobar/list_image.cgi/hogeãã§ã/hogeãã«ã¢ã¯ã»ã¹ã§ããã
$ curl https://example.com/list_cgi/2017-08-01
CGIã¹ã¯ãªããã«ã¢ã¯ã»ã¹ããå ´åãããã©ã«ãã§ã¯JSONãè¿ããããããããAcceptããã㧠application/xhtml+xml ã¨ã application/xml ã¨ã text/html ã¨ããæå®ããã¨ãXHTML5ï¼XML-serialized HTML 5ï¼ã®ãã¼ã¿ãè¿ãã¦ããããã«ãªãããã©ã¦ã¶ã§é²è¦§ã§ããã®ã¯ãã®ããã§ããã
CGIã¹ã¯ãªãããåãä»ãããã©ã¡ã¼ã¿ã¯ã³ãã³ãã©ã¤ã³ã§æå®ã§ãããã©ã¡ã¼ã¿ã¨å ¨ãåããªã®ã§ã--help ã§ä»æ§ã確èªããããããã ããCGIã¢ã¼ãã ãã®ç¹å¥ãªè¨å®ã¨ãã¦ãããã¤ãã®ãã©ã¡ã¼ã¿ã®ããã©ã«ãå¤ãä¸æ¸ãããã¦ãããlist_image.py ã®åé ã®å®æ°å®ç¾©ãæ¸ãæããã°ãã®è¾ºãã®æåãå¤ãããã¨ãã§ããã
è¨è¨ææ³
ä¸å¯¸ã®ã·ã¹ãã ã«ããäºåã®è¨è¨ææ³ãããã®ã ãä»åã¯ãã¨ããã¬ã¬ã·ã¼ã«å¾¹ãããåçãã«ã¿ãã°ãã¼ã¿ãæ ¼ç´ããã®ã¯ãã ã®ãã£ã¬ã¯ããªã§ãããåãªãå½åè¦åã§ãã¡ã¤ã«éã®ç´ä»ãããã¦ãããDBMSã使ã£ã¦ããªãããè¨å®ãã¡ã¤ã«ãããªããããããä»æ§ãåç´åãããã¨ã§ã¤ã³ã¿ã¼ãªãã©ããªãã£ã¯æ大åãããlist_image.pyã¯Pythonã§æ¸ããã¦ããããC++ã§ãJavaã§ãRubyã§ãåãæ©è½ãç°¡åã«å®ç¾ã§ããã ããããªããªãã·ã§ã«ã¹ã¯ãªããã§ã ã£ã¦æ¸ãããã¡ã¿ãã¼ã¿ãåãªãTSVãªã®ããfindã¨grepã ãã§æ¤ç´¢ãå®çµã§ããããã«ããããã ãã¡ã³ããããªãã£ã®ç¹ã§ãæå©ã ãããå ãã¼ã¿ããã¼ã¿ãã¼ã¹å ã®BLOBã¨ãã¦ä¿åãã¦ãã¦ãä»æ§æ¸ãã¡ããã¨å¼ãç¶ãã¦ããªãã£ããªããã¡ãã£ã¨ããå°çãè¦ãã ãããä»åã®ããã«åç´ãªãã管çè ãçªç¶é£½ãã¦å¤±è¸ªãããæ»ãã ããã¦ããã¼ã¿ã®å¼ãç¶ãã«è¦å´ãããã¨ã¯ãªãããã
list_image.pyããã®CGIã¹ã¯ãªããã®åºåãJSONãªã®ãã¤ã³ã¿ã¼ãªãã©ããªãã£ã®ããã ããã¢ç¨ã«HTMLãåºåãã¦ãã©ã¦ã¶ã§æä½ã§ããããã«ãããããããã¯ããã¾ã§ãã¢ã¨ãã£ã¼ã¸ããªãã£ãã¹ãã®ããã§ããããã¢ã®HTMLã¢ã¼ãã§ããJSONåºåã®å ã«ãªãåãé£æ³é åã®ã¿ã使ã£ã¦ã¬ã³ããªã³ã°ãè¡ã£ã¦ãããã¤ã¾ãããã¢ã§ã§ãããã¨ã¯JSONãã¼ã¿ãåãåã£ããããªãã¯ã©ã¤ã¢ã³ãã§ãå®ç¾ã§ãããã¨ãä¿è¨¼ããã¦ãããããªãã¡ãAJAXãªJavaScriptã³ã¼ããHTMLææ¸ããå¼ã³åºãã ãã§ãä»»æã®æ©è½ãæã£ãåçé²è¦§ãµã¤ããä½ããã¨ãã§ããããã¡ããAndroidãiPhoneã®ã¢ããªãæ¸ããã£ã¦ããããã¢ã§ã¯ã¨ã¼ã¸ã§ã³ãããã®åãªã¯ã¨ã¹ãã«å¯¾ãã¦ã«ã¿ãã°ã«å¯¾ããã¯ã¨ãªã1åããçºè¡ããªãã¨ããç¸ãã§éçºããããå®éã«ã¯è¤æ°åã®ãªã¯ã¨ã¹ããçºè¡ããã£ã¦ãããããããéåæçã«è¡ã£ã¦ããããã¹ã©ã¤ãã·ã§ã¼ã¨ãã¯éåæãã¼ã¿åå¾ã§å®è£ ããæ¹ãæ ¼å¥½ããã
MVCçãªè¦æ¹ãããã°ãcram_image.pyãlist_image.pyã¯MVCã®Modelé¨åã®ã¿ãæ å½ãã¦ãã¦ãViewã¨ãControllerã¨ãã¯åæã«ãã£ã¦ããã¨ããæ¹éã ãããã¦list_image.pyããªã½ã¼ã¹IDãREQUEST_PATHã¨ãã¦åãåã£ããJSONãè¿ãããããã®ã¯ã¡ãã£ã¨RESTfulã¢ã¼ããã¯ãã£ãæèãã¦ããããã ãä»åã¯åçã®è¿½å ãåé¤ã®å®è£ ããã¦ããªããããããããã®ãã¡ä½ãäºå®ã ãã§ãæ´æ°ç³»ã¯ã¡ãã£ã¨è¨è¨ãæ©ã¾ããã®ã§ãé²è¦§ç³»ã ãã§åºåã£ã¦å ¬éãã¦ã¿ãã
ã¾ã¨ã
ã¯ã©ã¦ãç³»ã®åçãµã¤ãã«åçãé ããã®ã¯ä¾¿å©ã ããããã¯ãã¼ã¿ä¿è·ã®è¦³ç¹ãããéè¦ãªãã¨ã ãã§ããDIYæ´¾ã®äººã¯ãèªåã§ç®¡çãããã£ã¦æãã ããã大æã®ãµã¼ãã¹ã¯æ¦ãã¦è¯ãããã¡ãã£ã¨ãããã¨ããã«æãå±ããªãã¨ãæã£ã¡ãããã¨ãããã ããããããªããªãã«ã¯ãã²cram_image.pyã¨list_image.pyã使ã£ã¦ã¿ã¦ã»ãããã俺ã®èããæå¼·ã®åçé²è¦§ãµã¤ããã¯ããªãã«ããä½ããªãã®ã ããã
åçã¯æãåºã®ä»ç®ãå¾ã§è¦è¿ãããã«æ®ã£ã¦ããããã ããåçæ好家ã»ã«ã¡ã©æ好家ã®è«¸å å§ã§é²è¦§ç°å¢ã®æ¹åã«ç±æã注ãã§ãã人ã¯å°ãªãããã«æãããç´ æµãªåçãæ®ãã®ã大äºã ããä¸åº¦ããè¦ãªãã®ã§ã¯ãã£ãããªããç§ã¯ãåéãã¹ãã¼ããã©ã³ãæã¤ããã«ãªã£ãæã«ã使ã£ã¦ããããã·ã¹ãã ãä½ããããã¡ã¨å¤§ããã ããèªå·±è¯å®æã®åä¸ã«ãããå½¹ç«ã¤ãã¨ãããã ããã
Just Look 'n Learn English Picture Dictionary (Just Look ©n Learn Picture Dictionary Series)
- ä½è : Daniel Hochstatter
- åºç社/ã¡ã¼ã«ã¼: McGraw-Hill
- çºå£²æ¥: 2003/01/31
- ã¡ãã£ã¢: ãã¼ãã«ãã¼
- è³¼å ¥: 2人 ã¯ãªãã¯: 1å
- ãã®ååãå«ãããã° (3件) ãè¦ã
- åºç社/ã¡ã¼ã«ã¼: ã½ãã¼(SONY)
- çºå£²æ¥: 2012/06/15
- ã¡ãã£ã¢: ã¨ã¬ã¯ãããã¯ã¹
- è³¼å ¥: 1人 ã¯ãªãã¯: 115å
- ãã®ååãå«ãããã° (66件) ãè¦ã
OLYMPUS ãã©ã¼ã¬ã¹ä¸ç¼ OM-D E-M10 MarkII 14-42mm EZã¬ã³ãºããã ã·ã«ãã¼
- åºç社/ã¡ã¼ã«ã¼: ãªãªã³ãã¹
- çºå£²æ¥: 2015/11/07
- ã¡ãã£ã¢: Camera
- ãã®ååãå«ãããã°ãè¦ã